
并查集
双之城
额外去惹人王企鹅
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
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 · 861 阅读 · 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 · 509 阅读 · 0 评论 -
hdu-3635 Dragon Balls(并查集)
题意:进行两步操作 T A原创 2014-04-12 15:56:52 · 512 阅读 · 0 评论