![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集
Wabrush
这个作者很懒,什么都没留下…
展开
-
并查集详解 (转)
并查集是我暑假从高手那里学到的一招,觉得真是太精妙的设计了。以前我无法解决的一类问题竟然可以用如此简单高效的方法搞定。不分享出来真是对不起party了。(party:我靠,关我嘛事啊?我跟你很熟么?) 来看一个实例,杭电1232畅通工程 首先在地图上给你若干个城镇,这些城镇都可以看作点,然后告诉你哪些对城镇之间是有道路直接相连的。最后要解决的是整幅图的连通性问题。比如随意给你两个点,让你判转载 2017-06-08 15:50:48 · 274 阅读 · 0 评论 -
poj 1182 食物链(思维+并查集)
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31929 Accepted: 9326 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物转载 2017-06-19 21:11:29 · 226 阅读 · 0 评论 -
POJ-2235 Wireless Network (并查集)
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n原创 2017-06-08 16:51:36 · 502 阅读 · 0 评论 -
HDU - 3038 How Many Answers Are Wrong(带权并查集)
Problem Description TT and FF are … friends. Uh… very very good friends -__-bFF 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原创 2017-08-15 10:23:37 · 294 阅读 · 0 评论