[Ch.5 - DFS/BFS] 미로 탈출
My code from collections import deque n,m = map(int,input().split()) miro = [] for i in range(n): miro.append(list(map(int,input().split()))) dx = [-1,1,0,0] dy = [0,0,-1,1] def bfs(x,y): queue = deque() queue.append((x,y)) while queue: x, y = queue.popleft() for i in range(4): nx = x + dx[i] ny = y + dy[i] if nx = n or ny = m: continue if miro[nx][ny] == 0: continue if miro[nx][ny] == 1: miro[n..
2022. 2. 11.