求连通块个数 (并查集思路)

  今天复习DFS时作到连通块的题,忽然发现并查集也能够搞 我就试试没想到还真能弄。。。。ios /spa /3d /code   #include <iostream> #include <string> using namespace std; const int M=10000+100; string s[110]; int fa[M]; int get(int x) { if(fa
相关文章
相关标签/搜索