
并查集
文章平均质量分 76
xutian_curry
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
最小堆+并查集实现最小生成树的kursutra算法
#include <iostream> #include <queue> #include <vector> using namespace std; int N,M; int father[105]; int MST; struct edage { int source,End,length; edage(int ss,int ee,int l...原创 2018-04-15 22:23:27 · 387 阅读 · 0 评论 -
种类并查集 食物链
#include <stdio.h> #include <iostream> #include <stack> #include <string> #include <set> #include <memory.h> #include <math.h> #include <algorithm&原创 2018-05-20 10:07:59 · 321 阅读 · 0 评论 -
种类并查集 发现它 抓住它
tag[i] 表示 i 结点 与其父节点是否在同一个集合中(表示的是一种相对关系)GetFather时:压缩路径,同时更新tag[i]合并时:更新tag[father[i]]#include <stdio.h> #include <iostream> #include <stack> #include <string> #include <se...原创 2018-05-16 15:37:06 · 1489 阅读 · 0 评论 -
种类并查集 A Bug's Life
跟发现它抓住它完全一样。注意:当发现同性恋时不能直接break,因为还有输入数据#include <stdio.h> #include <iostream> #include <stack> #include <string> #include <set> #include <memory.h> #include <ma...原创 2018-05-16 16:54:02 · 503 阅读 · 0 评论