#include#include int n,m;int father[1000],rank[1000];int count;int find(int x){ if(father[x]==x) return x; else return father[x]=find(father[x]);}void unit(int x,int y){ x=find(x); y=find(y); if(x==y) return; if(rank[x]
本文共 342 字,大约阅读时间需要 1 分钟。
#include#include int n,m;int father[1000],rank[1000];int count;int find(int x){ if(father[x]==x) return x; else return father[x]=find(father[x]);}void unit(int x,int y){ x=find(x); y=find(y); if(x==y) return; if(rank[x]
转载于:https://www.cnblogs.com/clljs/p/9931838.html