![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
双之城
额外去惹人王企鹅
展开
-
zoj-1789
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=1789 题意:查找与0有关的人 即为SARS 并查集 #include #include #include using namespace std; int father[30005]; int rank[30005] ; int n,m; void init(原创 2014-01-12 13:20:18 · 825 阅读 · 0 评论 -
nyoj-最舒适的路线
#include #include #include using namespace std; int father[505]; struct node { int a,b,v; }s[5005]; int n; void init() { for(int i = 0;i <=n;i++) father[i] = i; } bool cmp(node p,node原创 2014-04-10 21:36:35 · 470 阅读 · 0 评论 -
hdu-3635 Dragon Balls(并查集)
题意:进行两步操作 T A原创 2014-04-12 15:56:52 · 473 阅读 · 0 评论