
并查集
纯真zwj
这个作者很懒,什么都没留下…
展开
-
数据结构之并查集
振宇大牛写的总结,很棒,转载一下,Orz。。。。原文链接:点击打开链接 引述之类的就免了,我们现在做题碰到的并查集基础题目大都是连通城市(或者村庄学校),接下来我们就称每一个城市为一个元素。我们解决此类题目运用的是树结构,每个集合用一棵树表示,而树的节点用于存储集合中的元素名。举个实例:有A,B,C,D这4个城市,我们用树结构连通的形式如下:转载 2015-07-27 18:10:32 · 488 阅读 · 0 评论 -
HDOJ 4496 D-City(并查集变形,逆序 删边)
D-CityTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 2656 Accepted Submission(s): 928Problem DescriptionLuxer is a really原创 2015-10-14 22:48:16 · 871 阅读 · 0 评论 -
POJ 1182 食物链 (并查集,坑题,好题)
食物链Time Limit: 1000MSMemory Limit: 10000KTotal Submissions: 55666Accepted: 16323Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,原创 2015-11-25 22:41:39 · 690 阅读 · 0 评论 -
HDOJ 5606 tree(并查集)
treeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 277 Accepted Submission(s): 147Problem DescriptionThere is a tree(the tree原创 2016-01-03 02:45:25 · 546 阅读 · 0 评论 -
POJ 2236 Wireless Network(并查集)
Wireless NetworkTime Limit: 10000MSMemory Limit: 65536KTotal Submissions: 20537Accepted: 8631DescriptionAn earthquake takes place in Sou原创 2016-01-13 17:10:23 · 505 阅读 · 0 评论 -
POJ 1703 Find them, Catch them(并查集)
Find them, Catch themTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 38474Accepted: 11839DescriptionThe police office in Tadu C原创 2016-01-13 18:01:26 · 464 阅读 · 0 评论 -
HDOJ 5631 Rikka with Graph(并查集)
Rikka with GraphTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 172 Accepted Submission(s): 74Problem DescriptionAs we know,原创 2016-02-21 00:33:39 · 1429 阅读 · 0 评论 -
Codeforces 741B Arpa's weak amphitheater and Mehrdad's valuable Hoses(并查集+分组背包)
Arpa's weak amphitheater and Mehrdad's valuable Hosestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJust t原创 2016-12-07 22:58:13 · 1221 阅读 · 0 评论 -
Codefocres 744A Hongcow Builds A Nation(并查集记录树上结点数)
Hongcow Builds A Nationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputHongcow is ruler of the world. As r原创 2016-12-18 22:43:36 · 636 阅读 · 0 评论 -
codeforces 766D Mahmoud and a Dictionary(扩展域并查集+map查询)
D. Mahmoud and a Dictionarytime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMahmoud wants to write a new dictionary that co...原创 2017-02-09 00:48:41 · 709 阅读 · 0 评论 -
NYOJ 711 最舒适的路线(并查集+枚举,贪心+欧几里德算法)
最舒适的路线时间限制:5000 ms | 内存限制:65535 KB难度:5描述 异形卵潜伏在某区域的一个神经网络中。其网络共有N个神经元(编号为1,2,3,…,N),这些神经元由M条通道连接着。两个神经元之间可能有多条通道。异形卵可以在这些通道上来回游动,但在神经网络中任一条通道的游动速度必须是一定的。当然异形卵不希望从一条通道游动到另一条通道速度变化太大,否则它会很原创 2015-10-13 21:49:25 · 693 阅读 · 0 评论 -
HDOJ 3635 Dragon Balls(并查集)
Dragon BallsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4741 Accepted Submission(s): 1799Problem DescriptionFive hundre原创 2015-11-13 16:07:13 · 640 阅读 · 0 评论 -
HDOJ 1598 find the most comfortable road(并查集+枚举,贪心)
find the most comfortable roadTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5309 Accepted Submission(s): 2305Problem Descri原创 2015-10-12 22:26:45 · 519 阅读 · 0 评论 -
HDOJ 1272 小希的迷宫(并查集)
小希的迷宫Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 34158 Accepted Submission(s): 10450Problem Description上次Gardon的迷宫城堡小希玩了很久(原创 2015-07-27 17:51:32 · 589 阅读 · 0 评论 -
HDOJ 2120 Ice_cream's world I(并查集判断成环)
Ice_cream's world ITime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 778 Accepted Submission(s): 455Problem Descriptionice_cream'原创 2015-07-29 11:07:52 · 1091 阅读 · 2 评论 -
HDOJ 1856 More is better(并查集,记录树的节点数)
More is betterTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 327680/102400 K (Java/Others)Total Submission(s): 18606 Accepted Submission(s): 6845Problem DescriptionMr Wang wa原创 2015-07-29 15:31:49 · 899 阅读 · 0 评论 -
HDOJ 1232 畅通工程(并查集)
畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 37018 Accepted Submission(s): 19624Problem Description某省调查城镇交通状况,得到现有城镇道路统计原创 2015-07-24 15:14:19 · 510 阅读 · 0 评论 -
HDOJ 1213 How Many Tables(并查集)
How Many TablesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17935 Accepted Submission(s): 8813Problem DescriptionToday is Ig原创 2015-07-24 20:47:47 · 952 阅读 · 0 评论 -
HDOJ 4707 Pet(并查集)
PetTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1777 Accepted Submission(s): 856Problem DescriptionOne day, Lin Ji wake up i原创 2015-08-05 17:28:52 · 483 阅读 · 0 评论 -
HDOJ 2473 Junk-Mail Filter(并查集删点)
Junk-Mail FilterTime Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7677 Accepted Submission(s): 2420Problem DescriptionRecogn原创 2015-10-18 22:34:32 · 484 阅读 · 0 评论 -
NYOJ 1022 合纵连横(并查集删点)
合纵连横 时间限制:1000 ms | 内存限制:65535 KB难度:3描述 乱世天下,诸侯割据。每个诸侯王都有一片自己的领土。但是不是所有的诸侯王都是安分守己的,实力强大的诸侯国会设法吞并那些实力弱的,让自己的领土面积不断扩大。而实力弱的诸侯王为了不让自己的领土被吞并,他会联合一些其他同样弱小的诸侯国,组成联盟(联盟不止一个),来共同抵抗那些强大的诸侯国。原创 2015-10-18 22:49:59 · 479 阅读 · 0 评论 -
POJ 1611 The Suspects(并查集)
The SuspectsTime Limit: 1000MS Memory Limit: 20000KTotal Submissions: 28347 Accepted: 13820DescriptionSevere acute respiratory syndrome (SARS), an atypical pneumoni原创 2015-10-12 13:54:43 · 401 阅读 · 0 评论 -
codeforces 776D The Door Problem(带权并查集)
D. The Door Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMoriarty has trapped n people in n dist原创 2017-02-25 15:20:29 · 1243 阅读 · 0 评论