并查集
hpugym
这个作者很懒,什么都没留下…
展开
-
并查集
Problem Description Today 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原创 2014-08-01 12:06:56 · 393 阅读 · 0 评论 -
hdu 1232 畅通工程
Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000 )和原创 2014-08-01 12:06:13 · 319 阅读 · 0 评论 -
畅通工程汇总
1: Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N ( < 1000原创 2014-08-07 17:58:09 · 779 阅读 · 0 评论 -
poj 2236 Wireless Network 之幷查集
Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all compu原创 2014-11-26 19:21:43 · 425 阅读 · 0 评论 -
hdu 2682 Tree 最小生成树 (并查集)
Tree Time Limit : 6000/2000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 26 Accepted Submission(s) : 10 Font: Times New Roman | Verdana | Georgia Font原创 2015-03-26 17:43:04 · 723 阅读 · 0 评论 -
poj 1611 并查集 + 压缩路径
B - The Suspects Time Limit:1000MS Memory Limit:20000KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1611 Description Severe acute respiratory syndrome (SARS),原创 2015-03-06 17:34:15 · 353 阅读 · 0 评论 -
hdu 1272 小希的迷宫 并查集
M - 小希的迷宫 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1272 Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。原创 2015-03-08 21:46:25 · 413 阅读 · 0 评论 -
hdu D-City 反向并查集
D-City Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 2134 Accepted Submission(s): 751 Problem Description Luxer is a really bad原创 2015-04-23 20:13:59 · 796 阅读 · 0 评论