
并查集
blue_cgt
这个作者很懒,什么都没留下…
展开
-
牛客多校__Explorer
https://ac.nowcoder.com/acm/contest/888/E 题意:给你一个无向图,其中每条边都有限制的大小区间可以通过,询问从1到n总共有多少个数字可以通过(即从1到n) 题解:由于m的范围很大,所以我不能单纯的跑图,所以我们可以用时间分治的思想,先把每个区间离散化,然后加入线段树中,然后跑线段树,跑的过程做并查集(即将相连的边归为一类)然后就可以查询答案了,跑完一个子...原创 2019-08-11 22:59:11 · 132 阅读 · 0 评论 -
2018-german-collegiate-programming-contest-gcpc-18-en-Problem M: Mountaineers
The Chilean Andes have become increasingly popular as a destination for backpacking and hiking. Many parts of the Andes are quite remote and thus dangerous. Because of this, the Ministry o...原创 2019-09-28 17:41:23 · 356 阅读 · 0 评论