并查集
文章平均质量分 76
sunshine668
这个作者很懒,什么都没留下…
展开
-
hdu1232 畅通工程
Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N (原创 2014-04-01 22:47:15 · 403 阅读 · 0 评论 -
POJ 1611 The Suspects
Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best原创 2014-04-01 23:07:39 · 297 阅读 · 0 评论 -
POJ 2524 Ubiquitous Religions
Description There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many different religions students in you原创 2014-04-03 14:36:55 · 308 阅读 · 0 评论 -
HDU-1272 小希的迷宫
Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她原创 2014-04-03 14:43:03 · 552 阅读 · 0 评论 -
POJ 2942 A Bug's Life
Description Background Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of t原创 2014-04-03 14:51:56 · 458 阅读 · 0 评论 -
HDU 1598 find the most comfortable road
Description XX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即乘坐过程中最高速度与最低速度的差越小乘坐越舒服 ,(理解为SARS的限速要求,flycar必须瞬间提速/降速,痛原创 2014-04-03 14:56:59 · 340 阅读 · 0 评论 -
POJ 2236Wireless Network
Problem 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,原创 2014-04-09 20:22:40 · 380 阅读 · 0 评论 -
hdu1856 More is better
Problem Description 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 requirements.原创 2014-04-01 22:55:07 · 386 阅读 · 0 评论 -
HDU 3038 How Many Answers Are Wrong
Description TT and FF are ... friends. Uh... very very good friends -________-b FF is a bad boy, he is always wooing TT to play the following game with him. This is a very humdrum game. To begin原创 2014-04-03 15:07:21 · 312 阅读 · 0 评论