BFS36 [백분] 13913번 - 숨바꼭질 3 (파이썬) # 숨바꼭질 3 from collections import deque def bfs(): q = deque() q.append(N) while q: now = q.popleft() if now == M: return visited[now] for k in [now-1, now+1, now*2]: nnow = k if 0 2022. 1. 20. 이전 1 ··· 3 4 5 6 다음