[백준/BOJ] 4963번 - 섬의 개수 (C++)
문제 링크 코드 #include using namespace std; #define X first #define Y second int h, w; int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1}; int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1}; int main(void) { ios::sync_with_stdio(0); cin.tie(0); int i, j; while (1) { int board[51][51] = { 0, }; bool vis[51][51] = { 0, }; int cnt = 0; cin >> w >> h; if (w == 0 && h == 0) break; for (i = 0; i < h; i++) for (j = 0; j < w; j++..
2022. 3. 24.