From b6f0426999386f898d78519a4ed821a95150ff9b Mon Sep 17 00:00:00 2001 From: Jongmin Date: Sat, 5 Nov 2022 02:58:21 +0900 Subject: [PATCH] =?UTF-8?q?[=EA=B5=AC=ED=98=84]=20=EC=98=88=EC=A0=9C=20?= =?UTF-8?q?=EB=B0=8F=20=EC=8B=A4=EC=A0=84=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0(=EA=B9=80=EC=A2=85=EB=AF=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\352\265\254\355\230\204/example1.py" | 24 ++++++++++++++++++++++++ "\352\265\254\355\230\204/example2.py" | 11 +++++++++++ "\352\265\254\355\230\204/example3.py" | 25 +++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 "\352\265\254\355\230\204/example1.py" create mode 100644 "\352\265\254\355\230\204/example2.py" create mode 100644 "\352\265\254\355\230\204/example3.py" diff --git "a/\352\265\254\355\230\204/example1.py" "b/\352\265\254\355\230\204/example1.py" new file mode 100644 index 0000000..5057912 --- /dev/null +++ "b/\352\265\254\355\230\204/example1.py" @@ -0,0 +1,24 @@ +N = int(input()) + +spot = [1,1] +command = list(map(str, input().split())) + +for i in command: + if i == "R": spot[1] += 1 + + elif i == "L": spot[1] -= 1 + + elif i == "U" : spot[0] -= 1 + + elif i == "D" : spot[0] += 1 + + if spot[0] == 0 : spot[0] += 1 + + elif spot[0] == N+1 : spot[0] -= 1 + + elif spot[1] == 0 : spot[1] += 1 + + elif spot[1] == N+1 : spot[1] -= 1 + +print(spot[0], spot[1]) + diff --git "a/\352\265\254\355\230\204/example2.py" "b/\352\265\254\355\230\204/example2.py" new file mode 100644 index 0000000..d3c0d42 --- /dev/null +++ "b/\352\265\254\355\230\204/example2.py" @@ -0,0 +1,11 @@ +N = int(input()) + +cnt = 0 + +for h in range(0,N+1): + for m in range(0,60): + for s in range(0,60): + if '3' in str(h) or '3' in str(m) or '3' in str(s): + cnt += 1 + +print(cnt) diff --git "a/\352\265\254\355\230\204/example3.py" "b/\352\265\254\355\230\204/example3.py" new file mode 100644 index 0000000..5e7f787 --- /dev/null +++ "b/\352\265\254\355\230\204/example3.py" @@ -0,0 +1,25 @@ +N = input() +cnt = 0 +# 1 -> 오른쪽 -1 -> 왼쪽 +# 2 -> 아래 -2 -> 위 +path = [[1,1,2],[1,1,-2],[2,2,1],[2,2,-1],[-1,-1,2],[-1,-1,-2],[-2,-2,1],[-2,-2,-1]] + +for i in path: + x = ord(str(N)[0]) + y = int(str(N)[1]) + for j in i: + if j == 1: x += 1 + + elif j == 2: y += 1 + + elif j == -1: x -= 1 + + elif j == -2: y -= 1 + + + if (x>96 and x<105) and (y>0 and y<9): + cnt += 1 + +print(cnt) + +