백준 4963 파이썬 python : 섬의 개수 @@황소처럼 우직하게@@ 짜릿짜릿
import sys input = sys.stdin.readline dx = [1, -1, 0, 0, 1, 1, -1, -1] dy = [0, 0, 1, -1, 1, -1, 1, -1] def bfs(y, x, count): q = [[y, x]] while q: now = q.pop(0) for i in range(8): ny = now[0] + dy[i] nx = now[1] + dx[i] if 0