(BOJ) 5427 풀이
5427 #include #define X first #define Y second using namespace std; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; int fire[1002][1002], ar[1002][1002], visited[1002][1002]; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int T, w, h, flag = 0; cin >> T; while (T--) { flag = 0; cin >> w >> h; for (int i = 0; i < h; i++) { fill(fire[i], fire[i] + w, -1); fill(visited[i], visited[i] + w..
2022. 2. 8.
(BOJ) 1926 풀이
#include #define X first #define Y second using namespace std; int BFS(int x, int y); int ar[502][502], visited[502][502]; int dx[] = {1, 0, -1, 0}; int dy[] = {0, 1, 0, -1}; queue Q; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int N, M, count = 0, max = 0; cin >> N >> M; for (int i = 1; i ar[i][j]; } for (int i = 1; i
2022. 2. 4.