摘要: #include <stdio.h>#include <string.h>#define N 1001int ufs[N];int rank[N];bool rec[N];int getFather(int n){if(ufs[n]!=n) ufs[n]=getFather(ufs[n]);return ufs[n];}int merge(int a, int b){int ta=getFather(a) ;int tb=getFather(b) ;if(ta != tb)ufs[ta] = tb;return 0; }void count(int n){int i;i 阅读全文
posted @ 2012-03-29 19:01 阿刻 阅读(186) 评论(0) 推荐(0) 编辑