
并查集
文章平均质量分 80
sortmin
这个作者很懒,什么都没留下…
展开
-
HDU 1325 Is It A Tree?
HDU 1325 Is It A Tree? A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between nodes satisfying原创 2017-10-05 23:27:23 · 150 阅读 · 0 评论 -
HDU - 1272 - 小希的迷宫
小希的迷宫 HDU - 1272 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。原创 2017-10-05 22:41:18 · 221 阅读 · 0 评论 -
HDU - 1856 - More is better
More is betterHDU - 1856 Mr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requir原创 2017-10-06 00:30:29 · 224 阅读 · 0 评论 -
AtCoder Beginner Contest 087-D - People on a Line
D - People on a Line Time limit : 2sec / Memory limit : 256MB Score : 400 points Problem Statement There are N people standing on the x-axis. Let the coordinate of Person i be xi.原创 2018-02-02 23:22:54 · 275 阅读 · 0 评论 -
Codeforces Round #464 (Div. 2) (A,B,C,D,E,)
Codeforces Round #464 (Div. 2)题目链接:http://codeforces.com/contest/939A题题意:给定N个点以及它们的相互关系,问是否存在三元环。A题题解:遍历即可,遍历每个点和他们连接的下一个点,看下一个点与第一个点是否连通即可。AC代码:#include<bits/stdc++.h> using na...原创 2018-02-22 14:32:51 · 153 阅读 · 0 评论 -
CODEVS 1540 银河英雄传说(并查集)
1540 银河英雄传说题目链接:http://codevs.cn/problem/1540/题目描述 Description公元五八○一年,地球居民迁移至金牛座&alpha;第二行星,在那里发表银河联邦创立宣言,同年改元为宇宙历元年,并开始向银河系深处拓展。 宇宙历七九九年,银河系的两大军事集团在巴米利恩星域爆发战争。泰...原创 2018-04-10 01:41:16 · 272 阅读 · 0 评论 -
LA - 3644 - X-Plosives
LA3644 - X-Plosives题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1645题意:有N种简单化...原创 2018-05-13 04:12:18 · 255 阅读 · 0 评论 -
Slim Span UVA - 1395(并查集)
Slim Span UVA - 1395 题目链接:https://vjudge.net/problem/UVA-1395 题意:给定n个节点的图,求一个生成树使得生成树的最大边-最小边的差最小。 题解:按权值排序后遍历L-R的点看是否满足生成树的条件,满...原创 2018-05-19 00:53:51 · 234 阅读 · 0 评论