[BOJ 1194] 달이 차오른다, 가자 (Python) from collections import deque import sys input = sys.stdin.readline dx = [1, -1, 0, 0] dy = [0, 0, -1, 1] def bfs(): while q: x, y, key, cnt = q.popleft() for i in range(4): nx = x + dx[i] ny = y + dy[i] if 0 Algorithm | SQL/BOJ 2021. 4. 21. 16:43