[백준 2206번] 벽 부수고 이동하기
from collections import deque n, m = map(int,input().split()) maze = [list(map(int,list(input()))) for _ in range(n)] visited = [[[0]*m for _ in range(n)] for _ in range(2)] dx = [-1,1,0,0] dy = [0,0,-1,1] def bfs(): visited[0][0][0] = 1 queue = deque([(0,0,0)]) while queue: w,x,y = queue.popleft() if x == n-1 and y == m-1: return visited[w][x][y] for i in range(4): nx = x + dx[i] ny = y + dy[i]..
2023. 8. 4.