求連通塊個數 (並查集思路)

  今天覆習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
相關文章
相關標籤/搜索