随笔分类 -  数据结构_并查集

摘要:Description In order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels to exchange messages 阅读全文
posted @ 2018-12-06 23:28 霜雪千年 阅读(252) 评论(0) 推荐(0) 编辑
摘要:Description You are given an undirected graph consisting of n vertices and m edges. Your task is to find the number of connected components which are 阅读全文
posted @ 2018-07-15 13:30 霜雪千年 阅读(281) 评论(0) 推荐(0) 编辑
摘要:Problem Description: Problem Description: 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作 阅读全文
posted @ 2018-07-01 22:48 霜雪千年 阅读(489) 评论(0) 推荐(0) 编辑
摘要:Problem Description: A国有n座城市,编号为1~n,这n个城市之间没有任何交通线路,所以不同城市的居民之间不能互通,所以A国的人打算为这n个城市建立k条交通线(两座城市之间可以有两条及以上的线路),交通线只能贯穿两座城市p, q(存在p=q的情况,不用考虑但会占用一条交通线), 阅读全文
posted @ 2018-06-11 21:35 霜雪千年 阅读(452) 评论(0) 推荐(0) 编辑
摘要:Problem Description 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它 阅读全文
posted @ 2018-05-24 20:25 霜雪千年 阅读(276) 评论(0) 推荐(0) 编辑
摘要:Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input 测试输入包含若干测 阅读全文
posted @ 2018-05-23 17:39 霜雪千年 阅读(147) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-05-18 16:11 霜雪千年 阅读(216) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示