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) + +