![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM 图论----并查集
文章平均质量分 87
青山绿水之辈
奋斗青春年华
展开
-
HDU4313Matrix(用最小生成树思想,集合划分)
MatrixTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2598 Accepted Submission(s): 973Problem DescriptionMachines have once again原创 2015-03-25 23:10:11 · 801 阅读 · 0 评论 -
HDU2120Ice_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): 698 Accepted Submission(s): 398Problem Descriptionice_cream's原创 2015-03-03 21:06:30 · 981 阅读 · 0 评论 -
HDU3926Hand in Hand(搜索 或 并查集)
Problem DescriptionIn order to get rid of Conan, Kaitou KID disguises himself as a teacher in the kindergarten. He knows kids love games and works out a new game called "hand in hand".Initiall原创 2015-03-19 22:55:44 · 878 阅读 · 0 评论 -
HDU4126Genghis Khan the Conqueror(最小生成树+并查集)
Genghis Khan the ConquerorTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 327680/327680 K (Java/Others)Total Submission(s): 1687 Accepted Submission(s): 501Problem DescriptionG原创 2015-03-20 18:20:44 · 1435 阅读 · 0 评论 -
HDU1811Rank of Tetris(并查集+拓扑排序)
Rank of TetrisTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5683 Accepted Submission(s): 1622Problem Description自从Lele开发了Rating原创 2015-03-07 00:01:01 · 1090 阅读 · 0 评论 -
HDU3938Portal(并查集离线应用)求路的条数
PortalTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1017 Accepted Submission(s): 514Problem DescriptionZLGG found a magic theor原创 2015-03-22 14:25:18 · 921 阅读 · 0 评论 -
HDU2473Junk-Mail Filter(并查集的删点)经典
Junk-Mail FilterTime Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6526 Accepted Submission(s): 2093Problem DescriptionRecognizing原创 2015-03-22 15:44:01 · 770 阅读 · 0 评论 -
HUD3038How Many Answers Are Wrong(并查集)经典
How Many Answers Are WrongTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3063 Accepted Submission(s): 1181Problem DescriptionTT原创 2015-03-23 12:58:07 · 846 阅读 · 0 评论 -
POJ 3660Cow Contest(并查集+拓扑排序)
Cow ContestTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7567 Accepted: 4206DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participa原创 2015-04-22 22:16:54 · 1330 阅读 · 0 评论 -
BNUOJ33566 Cycling Roads(并查集+判断两线段相交)
Cycling RoadsTime Limit: 1000msMemory Limit: 65536KBThis problem will be judged on Ural. Original ID: 196664-bit integer IO format: %lld Java class name: (Any)Prev Submit Stat原创 2015-04-19 22:01:29 · 833 阅读 · 0 评论 -
CSU1601: War(并查集)
1601: WarTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 82 Solved: 24[Submit][Status][Web Board]DescriptionAME decided to destroy CH’s country. In CH’ country, There are N villages,原创 2015-05-03 20:18:43 · 895 阅读 · 0 评论 -
HDU3234Exclusive-OR(并查集)与HDU3038相似
Exclusive-ORTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2383 Accepted Submission(s): 667Problem DescriptionYou are not given原创 2015-03-25 18:28:58 · 856 阅读 · 0 评论 -
HDU2144Evolution(并查集+暴力或LCS)
EvolutionTime Limit: 20000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 598 Accepted Submission(s): 143Problem Description Every kind of livin原创 2015-03-15 22:51:14 · 998 阅读 · 0 评论 -
并查集
并查集:(union-find sets)一种简单的用途广泛的集合. 并查集是若干个不相交集合,能够实现较快的合并和判断元素所在集合的操作,应用很多,如其求无向图的连通分量个数等。最完美的应用当属:实现Kruskar算法求最小生成树。l 并查集的精髓(即它的三种操作,结合实现代码模板进行理解):1、Make_Set(x) 把每一个元素初始化为一个集合初始化后每一个原创 2013-05-26 21:17:51 · 899 阅读 · 0 评论 -
hdu1272(小希迷宫 并查集)
Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。原创 2013-05-27 13:23:45 · 1019 阅读 · 0 评论 -
hdu1213(How Many Tables 并查集)
Problem DescriptionToday is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the frien原创 2013-05-30 22:55:35 · 964 阅读 · 0 评论 -
hdu1232(畅通工程 并查集)
Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路?Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000原创 2013-06-02 13:33:12 · 903 阅读 · 0 评论 -
hdu2545 树上战争 (并查集)
Problem Description给一棵树,如果树上的某个节点被某个人占据,则它的所有儿子都被占据,lxh和pfz初始时分别站在两个节点上,谁当前所在的点被另一个人占据,他就输了比赛,问谁能获胜Input输入包含多组数据每组第一行包含两个数N,M(N,M接下来N-1行,每行2个整数A,B(1接下来M行,每行有2个数,表示lxh和pfz的初始位置的编号X,Y(原创 2013-07-31 17:52:53 · 1129 阅读 · 0 评论 -
hdu1856 More is better(并查集,运用了压缩路径)
Problem DescriptionMr 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 requirements.原创 2013-07-31 21:06:32 · 1017 阅读 · 0 评论 -
hnsd11348tree(并查集)
Problem descriptionA graph consists of a set of vertices and edges between pairs of vertices. Two vertices are connected if there is a path (subset of edges) leading from one vertex to another原创 2013-09-01 22:49:44 · 1075 阅读 · 0 评论 -
hdu1598find the most comfortable road(并查集+枚举,求起点到终点的边中最大边减最小边差值最小)
Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提原创 2014-05-16 00:00:44 · 1225 阅读 · 0 评论 -
poj2513Colored Sticks(欧拉通路+字典树+并查集)
DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight line such that the colors of the endpoin原创 2014-07-26 09:54:16 · 1121 阅读 · 0 评论 -
FZU2112 Tickets (并查集+欧拉通路)经典
Problem 2112 Tickets Accept: 309 Submit: 526Time Limit: 3000 mSec Memory Limit : 32768 KB Problem DescriptionYou have won a collection of tickets on luxury cruisers. Each ticket原创 2014-12-09 14:45:13 · 1345 阅读 · 0 评论 -
HDU2860Regroup(并查集)
RegroupTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 660 Accepted Submission(s): 161Problem DescriptionWhen ALPC42 got to a pan原创 2015-03-14 21:48:10 · 933 阅读 · 0 评论 -
HDU 3277 Marriage Match III(并查集+二分答案+最大流SAP)拆点,经典
Marriage Match IIITime Limit: 10000/4000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1581 Accepted Submission(s): 464Problem DescriptionPresumably,原创 2015-06-23 14:59:14 · 841 阅读 · 0 评论