摘要:View Code 1 #include<stdio.h> 2 int father[100005],members[100005]; 3 int find(int a) 4 { 5 if(father[a]!=a) 6 father[a]=find(father[a]); 7 return father[a]; 8 }//寻找祖先 9 int main()10 {11 int i,m,n,b,a,num=1;12 char ch;13 while(scanf("%d%d",&n,&m)==2)14 {15 if...
阅读全文