ACM__并查集
文章平均质量分 83
wust_zwl
学不死,就往死里学。
展开
-
CodeForces 25D(并查集)
DescriptionBerland Government decided to improve relations with neighboring countries. First of all, it was decided to build new roads so that from each city of Berland and neighboring countries i原创 2017-07-06 20:41:03 · 326 阅读 · 0 评论 -
并查集详解(转)
以前我无法解决的一类问题竟然可以用如此简单高效的方法搞定。不分享出来真是对不起party了。来看一个实例,杭电1232畅通工程首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间是有转载 2017-07-06 21:06:33 · 344 阅读 · 0 评论 -
hdu_1272-小希的迷宫(经典并查集)
上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高难度,小希希望任意两个房间有且仅有一条路径可以相通(除非走了回头路)。小希现在把她的设计图给你,让你帮忙判断她的设计图是否符合她的设计思路。比如下面的例子,前两个是符合条件的,但是最后一个却有两种方法从5到达8。原创 2017-07-08 23:03:52 · 332 阅读 · 0 评论 -
POJ 2492 A Bug's Life
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 the opposite gender. In his experiment, individual bugs and their interac原创 2017-07-10 08:30:43 · 256 阅读 · 0 评论 -
POJ_1611-The Suspects(并查集)
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 strategy is to separate the suspects from others. In the Not-Spreading-原创 2017-07-09 20:46:39 · 200 阅读 · 0 评论 -
HDU 1856 More is better(简单并查集) 【最大并查集人数模板】
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. Mr Wang selected a room big enough to hold the boys. The boy who are not been原创 2017-07-10 09:26:50 · 409 阅读 · 0 评论