随笔分类 -  并查集

摘要:小希的迷宫 上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从房间B走到房间A,为了提高 阅读全文
posted @ 2019-02-25 14:03 suvvm 阅读(433) 评论(0) 推荐(1)
摘要:Deepest Root A graph which is connected and acyclic can be considered a tree. The hight of the tree depends on the selected root. Now you are supposed 阅读全文
posted @ 2019-01-25 15:31 suvvm 阅读(389) 评论(0) 推荐(0)
摘要:Battle Over Cities It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways 阅读全文
posted @ 2018-12-16 20:34 suvvm 阅读(541) 评论(0) 推荐(0)