목록2667 (1)
황소개발자
백준 2667 파이썬 python : 단지번호붙이기 @@황소처럼 우직하게@@
import sys input = sys.stdin.readline dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] def bfs(y, x, count, total): q = [[y, x]] mat[y][x] = count total += 1 while q: now = q.pop(0) for i in range(4): ny = now[0] + dy[i] nx = now[1] + dx[i] if 0
백준 문제 풀이
2020. 3. 2. 19:52