Greedy
Youngsung Choi Youngsung Choi { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### in : ์ ์ N\n", "### out : ์ซ์ 3์ด ๋ค์ด๊ฐ N์ 59 59์ด๊น์ง์ ๊ฐ์" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "5\n", "11475\n" ] } ], "source": [ "n = int(input())\n", "cnt = 0\n", "\n", "for hour in range(n+1):\n", " for minute in range(60):\n", " for second in range(60):\n", " if '3' in str(hour) + str(minute) + str(second):\n", " cnt = cnt + 1\n", " \n", "print(cnt)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### in : ๋ฌธ์์ด N ๋์ดํธ๊ฐ ์๋ ์์น\n", "### out : ๋์ดํธ๊ฐ ์์ง์ผ์ ์๋ ๊ฒฝ์ฐ์ ์" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "place = input()\n", "\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.6" } }, "nbformat": 4, "nbformat_minor": 4 }