【2018寒假集训Day 8】【并查集】并查集模板
Luogu并查集模板题
#include<cstdio>
using namespace std;
int z,x,y,n,m,father[10001];
int getfather(int v)//找到根节点
{
if (father[v]!=v) father[v]=getfather(father[v]);//路径压缩
return father[v];
...
原创
2018-02-08 15:45:53 ·
274 阅读 ·
0 评论