摘要:
View Code #include<stdio.h>#define N 2009int e[N];int f[N];int find(int pos){ if(f[pos]==-1)return pos; return f[pos]=find(f[pos]);}int un(int a,int b){ int fa=find(a),fb=find(b); if(fa==fb)return 0; f[fa]=fb;return 1;}int main(){ int t,n,m,rt,a,b,ca=0,i,T; scanf("%d",&T); t=T; w 阅读全文
posted @ 2011-02-25 16:08 huhuuu 阅读(237) 评论(0) 推荐(0) 编辑