const int MAXN=1005; int father[MAXN]; int find(int x)//寻找根结点 { if(x==father[x])return x; return father[x]=find(father[x]); //压缩路径 } void merge