[ BOJ / 파이썬 ] 7576 토마토
/ 풀이 1 / from collections import deque m, n = map(int, input().split()) tomatoes = [list(map(int, input().split())) for _ in range(n)] dx = [0, 0, -1, 1] dy = [-1, 1, 0, 0] ripped = [[False] * m for _ in range(n)] q = deque([]) day = 0 def bfs(q): new_q = deque([]) while q: x, y = q.pop() for i in range(4): nx = x + dx[i] ny = y + dy[i] if 0