[구름LEVEL] 단풍나무 (Python)
from copy import deepcopy row = int(input()) treemap = [] treesum = 0 for i in range(row): line = list(map(int,input().split())) treemap.append(line) treesum += sum(line) col = len(treemap[0]) day = 0 xs = [0, 0, -1, 1] ys = [1, -1, 0, 0] while treesum > 0: nextmap = deepcopy(treemap) for r in range(row): for c in range(col): if treemap[r][c] == 0: for x, y in zip(xs, ys): x, y = r+x, c+y if 0
2023. 2. 4.