[백준] 알고리즘 7576번 - 토마토 문제
#include using namespace std; int m, n,cnt=0; int check[1001][1001]; int dx[4] = { -1,0,1,0 }; int dy[4] = { 0,-1,0,1 }; queue qu; void bfs() { while (!qu.empty()) { int x = qu.front().first; int y = qu.front().second; qu.pop(); for (int i = 0; i < 4; i++) { int nx = x + dx[i]; int ny = y + dy[i]; if (nx=n || ny=m) continue; if (check[nx][ny] == 0) { check[nx][ny] = check[x][y]+1; qu.push(make_p..