토마토
-
[Java] 백준 7576 토마토Programming/Algorithm 2021. 2. 23. 04:23
문제 M x N 크기의 상자와 각 칸에 들어있는 토마토의 상태가 주어진다. (1: 익은 토마토, 0: 안익은 토마토, -1: 토마토 없음) 익은 토마토는 인접한 안익은 토마토를 익게만든다고 할 때, 토마토가 모두 익을 때까지 최소 날짜를 출력해라. 모두 익을 수 없는 경우엔 -1, 이미 모두 익어있는 경우엔 0을 출력한다. (2 = N || y = M) return false; return true; } static class Point { int x, y, days; public Point(int x, int y, int days) { this.x = x; this.y = y; this.days = days; } } } 채점결과