[백준] 2468 안전영역 BFS
from collections import dequen = int(input())arr = [list(map(int, input().split())) for _ in range(n)]def bfs(i,j,k,visited): q=deque() q.append([i,j]) dx=[0,0,1,-1] dy=[1,-1,0,0] while q: y,x = q.popleft() visited[y][x] = True for i in range(4): y_=y+dy[i] x_=x+dx[i] if 0y_n and 0x_n and not visited[y_][x_] and arr[y_][x_]>k: ..