
并查集
Dreamlandzxx
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
并查集
第一次写博客,好激动。。。 并查集 首先先举个例子:杭电oj1232畅通工程 首先我们定义一个find函数当输入一个数x时能够找到它的根节点 father[]表示每个点的前导点 最后一个点的前导点是它本身,所以找到最后一个点,第一个点到最后一个点就是就是一条畅通的道路。 find(int x) { int r=x; while(father[r]!=r) { r=father原创 2016-04-19 22:09:56 · 356 阅读 · 0 评论 -
POJ 1611 The Suspects(并查集)
The Suspects Time Limit: 1000MS Memory Limit: 20000K Total Submissions: 35084 Accepted: 17044 Description Severe acute respiratory syndrome (SARS), an atypical pneumo原创 2016-12-06 19:04:40 · 353 阅读 · 0 评论 -
HDOJ 1829 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 gen原创 2017-04-14 17:02:00 · 377 阅读 · 0 评论