[BAEKJOON]7569 토마토
문제 요약알고리즘 분류: BFS, 그래프난이도: Gold5문제내용:문제풀이 CodePythonimport sysfrom collections import dequeinput = sys.stdin.readlinedef solution(boxs, location): dx = [0, -1, 0, 1] dy = [-1, 0, 1, 0] dz = [-1, 1] days = 0 queue = location while queue: z, y, x = queue.popleft() value = boxs[z][y][x] for i in range(4): fx = x + dx[i] fy = y + dy[i]..
2024. 11. 9.