hdu1232简单并差集(2)
摘要:
View Code 1 #include<stdio.h> 2 int father[1005]; 3 int findset(int x) 4 { 5 return x==father[x]?x:(father[x]=findset(father[x])); 6 } 7 int main() 8 { 9 int n,m,i,a,b,x,y,k;10 while(scanf("%d %d",&n,&m)&&n)11 {12 13 for(i=1;i<=n;i++)14 {15 father[i]=i;16... 阅读全文
posted @ 2013-04-18 21:27 biying 阅读(136) 评论(0) 推荐(0)
浙公网安备 33010602011771号