![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
cwb丶
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #541 (Div. 2) F. Asya And Kitten 双向链表(并查集) stl之list
F. Asya And Kittens time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Asya loves animals very much. Recently, she purchased n kittens, enumerate...原创 2019-02-28 15:08:06 · 243 阅读 · 1 评论 -
How Many Answers Are Wrong (彻底理解带权并查集)
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 with, TT should ...原创 2019-03-05 14:50:24 · 266 阅读 · 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句话,...原创 2019-03-07 12:51:51 · 178 阅读 · 0 评论 -
Navigation Nightmare POJ - 1984(带权并查集)
Farmer John's pastoral neighborhood has N farms (2 <= N <= 40,000), usually numbered/labeled 1..N. A series of M (1 <= M < 40,000) vertical and horizontal roads each of varying lengths (1 ...原创 2019-04-03 20:47:10 · 174 阅读 · 0 评论 -
True Liars (思维想法+带权并并查集+01背包)
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...原创 2019-03-26 18:04:00 · 285 阅读 · 0 评论 -
Supermarket POJ - 1456(贪心+并查集)
超市里有N个商品. 第i个商品必须在保质期(第di天)之前卖掉, 若卖掉可让超市获得pi的利润. 每天只能卖一个商品. 现在你要让超市获得最大的利润. (原题说明过于抽象) Input 多组数据. 每组数据第一行为N, 即超市的商品数目 之后N行数字. 第i行为 pi, di Output 对于每一组数据, 输出当前条件下超市的最大利润 Sample Input 4 50 2...原创 2019-04-02 21:32:27 · 246 阅读 · 0 评论 -
E. Two Teams(Codeforces Round #552 (Div. 3) E)(set+并查集 瞎搞)
E. Two Teams time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There arennstudents standing in a row. Two coaches are forming two...原创 2019-04-17 16:22:03 · 566 阅读 · 2 评论 -
In Touch(dijk+并查集优化)
There are n soda living in a straight line. soda are numbered by1,2,…,n1,2,…,nfrom left to right. The distance between two adjacent soda is 1 meter. Every soda has a teleporter. The teleporter ofii...原创 2019-07-30 09:30:49 · 172 阅读 · 0 评论