1. BFS - 코드 #BFS -> Queue from collections import deque dx=[1,0,-1,0] dy=[0,1,0,-1] #r,u,l,d -> have to be declared outside of the fuction.. def bfs(x,y, r,c, field, visited): q = deque([(x,y)]) #deque : bidirectional queue visited[x][y] = 1 # argument(x, y) passing cost = int(field[x][y]) #get values from maps[x][y].. initialize while q: cx, cy = q.popleft() for i in range(4): nr = cx + dx[i] n..