![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
文章平均质量分 72
她山之石
这个作者很懒,什么都没留下…
展开
-
hdu1198 二维并查集
将A-K的上下左右有出水口的标记为1,否则标记为0。在地图中根据两个方块的位置关系,判断出水口是否相接。扫描地图时,只需要判断当前方块和上边或者左边是否相接。#include#include#include#include#include#include#include#include#include#include#include#include#include#d原创 2015-08-12 15:53:57 · 559 阅读 · 0 评论 -
hdu1598 有向边 并查集
将所有边排序,从小到大枚举最小边,以这条边为开始找最小生成树(不一定包含所有点),根据find(a)和find(b)是否相等判断a到b是否有边,p[a]表示以a为起点指向能到达的点,即连通。#include#include#include#include#include#include#include#include#include#include#include#inc原创 2015-08-13 00:47:44 · 486 阅读 · 0 评论 -
uva1664 并查集
#include#include#include#include#include#include#include#include#include#include#include#include#include#define ll long long#define OJ_DEBUG 0#define READ_FILE 1using namespace std;co原创 2015-08-04 17:28:26 · 556 阅读 · 0 评论 -
hdu 1213 并查集
并查集基本题。#include#include#include#include#include#include#include#include#include#include#include#include#include#define LL long long#define OJ_DEBUG 0#define READ_FILE 0using namesp原创 2015-08-06 16:16:58 · 402 阅读 · 0 评论 -
hdu 1272 并查集
这道题坑多,看数据。0 01 1 0 01 2 2 1 0 01 2 2 3 4 5 5 6 0 0YesYesNoNo#include#include#include#include#include#include#include#include#include#include#include#include#include#def原创 2015-08-06 16:58:23 · 445 阅读 · 0 评论 -
hdu 1856 离散化+并查集
注意n=0的情况#include#include#include#include#include#include#include#include#include#include#include#include#include#define LL long long#define OJ_DEBUG 0#define READ_FILE 1using names原创 2015-08-06 20:55:54 · 492 阅读 · 0 评论