并查集
文章平均质量分 81
空待待啊
这个作者很懒,什么都没留下…
展开
-
True Liars POJ - 1417(并查集+dp)
题 After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despaired, he was still fortunate to remember a legend of the foggy island, which he had heard from原创 2021-10-27 19:22:02 · 102 阅读 · 0 评论 -
LibreOJ - 10066 新的开始
题目描述 发展采矿业当然首先得有矿井,小 FF 花了上次探险获得的千分之一的财富请人在岛上挖了 nn 口矿井,但他似乎忘记考虑的矿井供电问题…… 为了保证电力的供应,小 FF 想到了两种办法: 在这一口矿井上建立一个发电站,费用为 vv(发电站的输出功率可以供给任意多个矿井)。 将这口矿井与另外的已经有电力供应的矿井之间建立电网,费用为 pp。 小 FF 希望身为「NewBe_One」计划首席工程师的你帮他想出一个保证所有矿井电力供应的最小花费。 输入格式 第一行一个整数 nn,表示矿井总数。 第 2∼n+原创 2021-07-30 21:16:53 · 119 阅读 · 0 评论 -
UVA-11987 Almost Union-Find(并查集删除)
题 I hope you know the beautiful Union-Find structure. In this problem, you’re to implement something similar, but not identical. The data structure you need to write is also a collection of disjoint sets, supporting 3 operations: 1 p q Union the sets conta原创 2021-07-30 19:28:41 · 183 阅读 · 0 评论 -
食物链
食物链 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说出K句话,这K句话有的是真的,有的是假的。当一句话满足下列三条之一时,这句话就是假话,否则就是真话。 1) 当前的话与前面原创 2021-05-10 18:59:05 · 128 阅读 · 0 评论 -
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 interact原创 2021-05-13 19:04:34 · 245 阅读 · 0 评论