비트마스트 bfs. 외판원순회처럼dfs로 해보려다가 중대한 문제점을 발견했다. 내가 dfs return값, 메모이제이션 설계를 잘 못한다는 것이었다.. 특히 분기가 많아질수록.. 다음번엔 그거 보완해야겠다. 큰 깨달음을 얻은 문제. 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