183번째 문제 - 2667 단지번호붙이기
문제링크 : https://www.acmicpc.net/problem/2667 #include #include #include using namespace std; int N, via[101][101]; //dfs 후에 connected component size returnint dfs(int y, int x){if(y=N || x=N || via[y][x]==0) return 0;else{via[y][x] = 0;return 1 + dfs(y-1,x) + dfs(y+1,x) + dfs(y, x-1) + dfs(y, x+1);}}int main(){vector ans; //inputcin>>N;for(int i=0; ivia[i][j];}} //calcfor (int i = 0; i < N; i++){..