摘要:
1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 20000 + 5; 7 int fa[maxn]; 8 int d[maxn]; 9 10 int Find(int x){ 11 if (fa[x] != x){ 12 int root ... 阅读全文
摘要:
1 #include 2 #include 3 using namespace std; 4 const int maxn = 100000 + 10; 5 int fa[maxn]; 6 7 int Find(int x){ 8 if (x == fa[x]) 9 return x; 10 else 11 return f... 阅读全文