摘要:
树链剖分维护的都是点,而这道题要求的是边。 解决:就把边权下放,变成点权,注意下放后查询u到v的路径时要除去lca的点权,因为lca的点权是其父亲的边权 细节:线段树的加标记与等于标记的维护与下传 #include<bits/stdc++.h> using namespace std; #defin 阅读全文
摘要:
模板存一下:求前驱后继,求x的排名和排在的x名的数,删除和插入一个数。 /* https://blog.csdn.net/clove_unique/article/details/50630280 */ #include<bits/stdc++.h> using namespace std; #de 阅读全文