[백준/2667/파이썬] 단지번호붙이기
소스코드 from collections import deque N = int(input()) graph = [] for i in range(N): graph.append(list(map(int, input()))) def bfs(graph,x,y): dx = [-1,1,0,0] dy = [0,0,-1,1] queue = deque() queue.append((x,y)) graph[x][y] = 0 cnt = 1 while (queue) : x,y = queue.popleft() for i in range (4): ax = x + dx[i] ay = y + dy[i] if (ax = N) or (ay =N): continue if graph[ax][ay] == 1: graph[ax][ay] = 0 queu..