백준 4963 섬의 개수
https://www.acmicpc.net/problem/4963 #include #include using namespace std;int w, h;vector> map;vector> visited;// 8방향 (상, 하, 좌, 우 + 대각선)int dx[8] = { -1, -1, -1, 0, 0, 1, 1, 1 };int dy[8] = { -1, 0, 1, -1, 1, -1, 0, 1 };void DFS(int x, int y){ visited[y][x] = true; for (int i = 0; i = 0 && ny >= 0 && nx > w >> h; if (w == 0 && h == 0) break; map = vector>(h, vector(w)); ..
cote/Intermediate
2025. 4. 8. 05:23