人生列车

follow on!success!

导航

2014年7月24日 #

HDU1272 小希的迷宫 并查集

摘要: 参考网址:http://blog.sina.com.cn/s/blog_6827ac4a0100nyjy.html解题思路:由于这里出现的数字不一定连续的数字都会出现,所以设一个mark来标记数字是否出现过。每次输入一对数字的关系则进行查找根结点的函数,即:if(aa==bb){flag=1;}如果... 阅读全文

posted @ 2014-07-24 16:23 tianxia2s 阅读(179) 评论(0) 推荐(0) 编辑

1213 How Many Tables 简单的并查集问题

摘要: my code:#include #include #includeusing namespace std;int find(int num,int A []){while(num!=A[num])//{ num = A[num];return num;}//bool follow(int a... 阅读全文

posted @ 2014-07-24 11:56 tianxia2s 阅读(164) 评论(0) 推荐(0) 编辑