小梨花的连通图

题解: 直接对每个连通块进行染色即可。如果两个点在k张图中都是连通的,说明这两个点在k张图中的颜色都是一样的。 用map<vector,int>统计答案即可 染色问题 #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; int n, k, nowcolor; vector<int>color[maxn];
相关文章
相关标签/搜索