![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
树链剖分
DT2131
Rage, rage against the dying of the light.Do not go gentle into that good night.
展开
-
树剖自用模板
#include using namespace std; #define ls l,mid,rt*2 #define rs mid+1,r,rt*2+1 #define mi (l+r)/2 const int MAXN=5e4+7; const int INF=0x3f3f3f3f; vector edge[MAXN]; vector linkk[MAXN]; int n,m,q; in原创 2018-01-19 12:15:46 · 337 阅读 · 0 评论 -
牛客国庆集训派对Day6 I 清明梦超能力者黄YY
题意: 中文 思路: 染色部分树链剖分即可 对于倒数第K次染色,转化为正数第Q次,线段树维护颜色即可。 代码: #include <bits/stdc++.h> using namespace std; #define ls l,mid,rt*2 #define rs mid+1,r,rt*2+1 #define m...原创 2018-10-06 20:47:16 · 496 阅读 · 0 评论