250x250
반응형
Notice
Recent Posts
Recent Comments
Link
목록7576 (1)
N
(백준 c++)7576 토마토
#include #include #include using namespace std; int answer = 0, tomato = 0; queue q, tmp_q; int arr[1001][1001]; bool visited[1001][1001] = {false, }; void bfs(int M, int N, pair p) { int row = p.first; int col = p.second; q.pop(); //up if(row - 1 >= 0 && row - 1 = 0 && col < M && visited[row - 1][col] == false) { visited[row - 1][col] = true; arr[row - 1][col] = 1; tmp_q.push(make_p..
백준 알고리즘
2020. 6. 17. 15:42