https://www.acmicpc.net/problem/7576 # 코드import sysfrom collections import dequeM, N = map(int, sys.stdin.readline().split())graph = []for _ in range(N): graph.append(list(map(int, input().split())))q = deque()num = 0for i in range(N): for j in range(M): if graph[i][j] == 1: q.append([i, j])def bfs(): while q: dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] x, y = q.popleft() ..