![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
并查集学习
从简到难,学会如何灵活使用并查集。
YLYLND
这个作者很懒,什么都没留下…
展开
-
第二章:并查集例题Dragon Balls
并查集例题Dragon Balls Five hundred years later, the number of dragon balls will increase unexpectedly, so it's too difficult for Monkey King(WuKong) to gather all of the dragon balls together. His countr...原创 2020-03-12 19:25:57 · 248 阅读 · 0 评论 -
第一章:并查集函数操作初级模板。
并查集函数操作模板。 并查集用于一些不相交问题的合并。 此篇简单介绍操作模板。 //初始化并查集。 int tree[1000]; int treepoint[10000]; int height[10000]; void tree_init(int n) { for(int i=0; i<n; i++) { tree[i]=i; treepoint[i]=1;//此并查集有多...原创 2020-03-12 18:17:06 · 88 阅读 · 0 评论