2012年7月21日

【解题报告】【HDOJ1213】【并查集】How Many Tables

摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1213 1 #include<stdio.h> 2 #include<string.h> 3 int father[1005]; 4 int record[1005]; 5 int find(int x) 6 { 7 int t; 8 if(father[x]==x) 9 return x;10 t=find(father[x]);11 father[x]=t;12 return t;13 }14 int main()15 {16 in... 阅读全文

posted @ 2012-07-21 16:45 coding封神 阅读(122) 评论(0) 推荐(0) 编辑

导航