
문제 2667번: 단지번호붙이기 과 같이 정사각형 모양의 지도가 있다. 1은 집이 있는 곳을, 0은 집이 없는 곳을 나타낸다. 철수는 이 지도를 가지고 연결된 집의 모임인 단지를 정의하고, 단지에 번호를 붙이려 한다. 여 www.acmicpc.net 풀이 (Python) from collections import deque n=int(input()) arr=[] result=[] #각 단지의 집의 수 count=0 #result에 입력하기 위한 count변수 for _ in range(n):arr.append(list(map(int,list(input())))) visited=[[False for i in range(n)] for j in range(n)] #방문 여부 확인 def bfs(x,y): qu..