并查集
文章平均质量分 79
普通网友
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
并查集算法
所谓并查集,它是一个集合,这个集合的元素也是集合,他支持三种操作: MakeSet(x),建立一个只有一个元素x的集合X0,将这个集合放入并查集中; FindSet(x),在并查集中寻找一个元素S(注意并查集的元素S也是集合) ,满足 x属于S; Union(x,y), 将并查集中的元素S1,S2合并,其中x属于S1,y属于S2。 下面说说并查集的实现,其实很简单,用树来实现。所有属于原创 2014-02-15 16:12:18 · 731 阅读 · 0 评论 -
How Many Tables
hdu 1213 How Many Tables Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You原创 2014-02-18 10:55:17 · 526 阅读 · 0 评论 -
Friendship
Friendship A friend is like a flower, a rose to be exact, Or maybe like a brand new gate that never comes unlatched. A friend is like an owl, both b原创 2014-02-17 20:03:52 · 603 阅读 · 0 评论 -
More is better
More is better Problem Description Mr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the b原创 2014-02-19 09:42:30 · 581 阅读 · 0 评论
分享