并查集

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
using namespace std;
int find(int x)
{
if(x==fa[x])return x;
else return fa[x]=find(fa[x]);
}
int main()
{

return 0;
}
显示 Gitment 评论