摘要: /* ***********************************************Author :xryzEmail :523689985@qq.comCreated Time :5-3 19:23:22File Name :... 阅读全文
posted @ 2015-05-03 20:09 xryz 阅读(140) 评论(0) 推荐(0) 编辑
摘要: #includestruct node{ int parent; int up; int all;} n[30000+5];int Find(int x){ if(x!=n[x].parent) { int t=Find(n[x].pare... 阅读全文
posted @ 2015-05-03 16:56 xryz 阅读(143) 评论(0) 推荐(0) 编辑
摘要: int find(int x) { if(fa[x] == x) return x; fa[x] = find(fa[x]); return fa[x];}void unio(int x, int y) { int fx = fin... 阅读全文
posted @ 2015-05-03 13:32 xryz 阅读(107) 评论(0) 推荐(0) 编辑
摘要: #includeint bin[1024];int findx(int x){ while(bin[x]!=x) x=bin[x]; return x;}void mergeab(int x,int y){ int fx,fy; fx=findx... 阅读全文
posted @ 2015-05-03 10:06 xryz 阅读(102) 评论(0) 推荐(0) 编辑
摘要: #includeint bin[1024];int findx(int x){ while(bin[x]!=x) x=bin[x]; return x;}void mergeab(int x,int y){ int fx,fy; fx=findx... 阅读全文
posted @ 2015-05-03 10:02 xryz 阅读(94) 评论(0) 推荐(0) 编辑