반응형
목록 백준 인구이동 파이썬 (1)
KEEP GOING
[python] 백준 16234 : 인구이동 (BFS)
https://www.acmicpc.net/problem/16234 16234번: 인구 이동 N×N크기의 땅이 있고, 땅은 1×1개의 칸으로 나누어져 있다. 각각의 땅에는 나라가 하나씩 존재하며, r행 c열에 있는 나라에는 A[r][c]명이 살고 있다. 인접한 나라 사이에는 국경선이 존재한다. 모 www.acmicpc.net from collections import deque import sys sys.stdin = open('in3.txt', 'r') n, l, r = map(int, input().split()) board = [list(map(int, input().split())) for _ in range(n)] dx = [1,0,-1,0] dy = [0,1,0,-1] def process(x..
code review/bfs-dfs
2022. 1. 19. 14:56