
并查集
ZX_zengxi
哈哈
展开
-
Count The Pairs(hdu-4750)(最小生成树)
Count The Pairs(hdu-4750) With the 60th anniversary celebration of Nanjing University of Science and Technology coming soon, the university sets n tourist spots to welcome guests. Of course, Redwood forests in our university and its Orychophragmus violac原创 2017-08-05 19:09:18 · 445 阅读 · 0 评论 -
食物链(poj-1182)(带权并查集)
动物王国中有三类动物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) 当前的话与原创 2017-08-26 21:29:15 · 356 阅读 · 0 评论 -
Zjnu Stadium(hdu-3047)(带权并查集)
In 12th Zhejiang College Students Games 2007, there was a new stadium built in Zhejiang Normal University. It was a modern stadium which could hold thousands of people. The audience Seats made a circle. The total number of columns were 300 numbered 1--300,原创 2017-08-26 21:25:36 · 410 阅读 · 0 评论