구름LEVEL2 [구름LEVEL] 뒤통수가 따가워 (Python) - stack input() #초기화 answer = '0' ppl = list(map(int, input().split())) stack = [ppl[0]] for i in range(1, len(ppl)): p = ppl[i] cansee = 0 #볼 수 있는 신선의 수 while stack and stack[-1] 2023. 2. 5. [구름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. 이전 1 다음