[c++] ํ๋ก๊ทธ๋๋จธ์ค - ์ ๋ ฅ๋ง์ ๋๋ก ๋๋๊ธฐ(Level 2)
๋ฌธ์ ์ฝ๋ฉํ
์คํธ ์ฐ์ต - ์ ๋ ฅ๋ง์ ๋๋ก ๋๋๊ธฐ 9 [[1,3],[2,3],[3,4],[4,5],[4,6],[4,7],[7,8],[7,9]] 3 7 [[1,2],[2,7],[3,7],[3,4],[4,5],[6,7]] 1 programmers.co.kr ์ฝ๋ #include #include #include using namespace std; vectorgraph[101]; vectordivide; bool visited[101]; int group_cnt; int node_cnt[2]; void dfs(int node, pair cut){ visited[node] = 1; node_cnt[group_cnt]++; for(int i=0; i
2022. 4. 18.