114
n = int(input())
cnt = 0
# 시간 단위
for h in range(n+1):
# 분 단위
for m in range(60):
# 초 단위
for s in range(60):
if ( '3' in str(s) or '3' in str(m) or '3' in str(h) ):
cnt += 1
print(cnt)
116
k = input()
h = k[1]
w = k[0]
w = ord(w) - 96
cnt = 0
move_h = [-2, -1, 2, 1, -2, -1, 2, 1]
move_w = [-1, -2, -1, -2, 1, 2, 1, 2]
for i in range(8):
temp_h = int(h) + move_h[i]
temp_w = int(w) + move_w[i]
if ( 1 <= temp_h <= 8 and 1 <= temp_w <= 8 ):
cnt += 1
print(cnt)
119
n, m = map(int, input().split())
h, w, d = map(int, input().split())
arr = []
for _ in range(n):
temp = list(map(int, input().split()))
arr.append(temp)
land = 1
arr[h][w] = 2
cnt = 0
while True:
# 방향 회전 (1단계)
if d == 0:
d = 3
else:
d -= 1
# 갈 수 있는지 확인
if d == 0:
temp_h, temp_w = h - 1, w
elif d == 3:
temp_h, temp_w = h, w - 1
elif d == 2:
temp_h, temp_w = h + 1, w
elif d == 1:
temp_h, temp_w = h, w + 1
if arr[temp_h][temp_w] == 0:
land += 1
h, w = temp_h, temp_w
arr[h][w] = 2
cnt = 0
else:
cnt += 1
# 동서남북 갈 곳이 없으면
if cnt == 4:
if d == 0:
d = 3
else:
d -= 1
if d == 0:
temp_h, temp_w = h + 1, w
elif d == 3:
temp_h, temp_w = h, w + 1
elif d == 2:
temp_h, temp_w = h - 1, w
elif d == 1:
temp_h, temp_w = h, w - 1
if arr[temp_h][temp_w] == 1:
break
else:
h, w = temp_h, temp_w
print(land)
321 (브론즈2)
n = input()
num = len(n)//2
one = list(map(int, n[:num]))
two = list(map(int, n[num:]))
o = sum(one)
t = sum(two)
if (o == t):
print('LUCKY')
else:
print('READY')
322
s = input()
alpha = [i for i in s if i.isalpha()]
number = [int(j) for j in s if j.isdigit()]
alpha.sort()
num = sum(number)
alpha = "".join(alpha)
print(alpha + str(num))
323 (레벨2) 문제
def solution(s):
answer = len(s)
for i in range(1, (len(s)//2)+1 ):
word = ''
pivot = ''
cnt = 1
for j in range(0, len(s), i):
if ( s[j:j+i] == pivot ):
cnt += 1
else:
if (cnt != 1):
word = word + str(cnt) + pivot
else:
word = word + pivot
pivot = s[j:j+i]
cnt = 1
if (cnt != 1):
word = word + str(cnt) + pivot
else:
word = word + pivot
answer = min(answer, len(word))
return answer
325 (레벨3) 문제
329 (레벨3) 문제
332 (골드5) 문제
334 (레벨3) 문제