[Python] 백준 2178번 : 미로 탐색
https://www.acmicpc.net/problem/2178 import sysfrom collections import dequeinput = sys.stdin.readlinegraph = []N, M = map(int, input().split())for _ in range(N): graph.append(list(map(int, input().rstrip()))) def bfs(x, y): # 이동할 방향 정의 dx = [-1,1,0,0] dy = [0,0,-1,1] queue = deque() queue.append((x,y)) # 큐가 빌 때 까지 반복 while queue: x, y = queue.popl..
2024. 9. 8.