版本比较
总结
标题
增加 1 行删除 1 行
11一些总结总结正文
增加 576 行删除 176 行
112334556778910111213141516171819202122232425262728293031323391011343536373839404142434445464748491415505152535455565758596061626364656667686970717273747576777879228081828384852886878889909192939436959697989910010110244103104105106107495051108109110111112113114115116117118119120121122123124125126127606112812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821921 行未改动2412422432449798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551562452462472486 行未改动255256257258259260261262263272 行未改动全部展开536537538539451540541454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514542543544545113 行未改动全部展开659660661662636663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780638781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896640897898899900901902903904905906642643644907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973647974975649976977651978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014656101510166581017101866010191020662102110226641023102466610251026668102710286701029103067210311032103310341035103610371038675676103910401041678104210436801044104568210461047104810491050105110521053105410551056105768610581059688106010616901062106369210641065106610676961068106969810701071107210737021074107570410761077107810791080108110821083708108410851086108771210881089714109010917161092109371810941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119::::::success[各种常用数据结构全家桶]::::success[全家桶]
:::success[数组:$O(n)-O(1)$]:::success[Deque:$O(n)-O(1)$]```cppclass Array{class Deque{ private: int pre[MAXN]; vector<int> L,R; int sz; void balanceL(){ int sz=R.size(); dFor(i,sz/2,0){ L.push_back(R[i]); } dFor(i,sz-1,sz/2+1){ R[i-sz/2-1]=R[i]; } For(i,0,sz/2){ R.pop_back(); } } void balanceR(){ int sz=L.size(); dFor(i,sz/2,0){ R.push_back(L[i]); } dFor(i,sz-1,sz/2+1){ L[i-sz/2-1]=L[i]; } For(i,0,sz/2){ L.pop_back(); } } public: void build(int n,int *a){ For(i,1,n){ pre[i]=pre[i-1]+a[i]; void push_back(int x){ R.push_back(x); sz++; } void push_front(int x){ L.push_back(x); sz++; } void pop_back(){ if(sz==0) return ; if(R.empty()){ balanceR(); } R.pop_back(); sz--; } int query(int l,int r){ return pre[r]-pre[l-1]; void pop_front(){ if(sz==0) return ; if(L.empty()){ balanceL(); } L.pop_back(); sz--; } int size(){ return sz; } int front(){ if(sz==0) return -1; if(L.empty()){ balanceL(); } return L.back(); } int back(){ if(sz==0) return -1; if(R.empty()){ balanceR(); } return R.back(); }};```
:::
:::success[线段树:$O(n)-O(\log n)$]:::success[线段树 $\min,\max$:$O(n)-O(\log n)$]```cppclass SGT{ private: int a[MAXN]; struct Node{ int l,r,min; int l,r,min,max; }tr[MAXN*4]; void update(int c){ tr[c].min=min(tr[c*2].min,tr[c*2+1].min); tr[c].max=max(tr[c*2].max,tr[c*2+1].max); } void build(int c,int l,int r){ tr[c].l=l;tr[c].r=r; if(l==r){ tr[c].min=a[l]; tr[c].min=tr[c].max=a[l]; return ; } int mid=(l+r)/2; build(c*2,l,mid); build(c*2+1,mid+1,r); update(c); } int query(int c,int l,int r){ int querymin(int c,int l,int r){ if(tr[c].l==l&&tr[c].r==r){ return tr[c].min; } int mid=(tr[c].l+tr[c].r)/2; if(r<=mid) return query(c*2,l,r); else if(l>mid) return query(c*2+1,l,r); else return min(query(c*2,l,mid),query(c*2+1,mid+1,r)); if(r<=mid) return querymin(c*2,l,r); else if(l>mid) return querymin(c*2+1,l,r); else return min(querymin(c*2,l,mid),querymin(c*2+1,mid+1,r)); } int querymax(int c,int l,int r){ if(tr[c].l==l&&tr[c].r==r){ return tr[c].max; } int mid=(tr[c].l+tr[c].r)/2; if(r<=mid) return querymax(c*2,l,r); else if(l>mid) return querymax(c*2+1,l,r); else return max(querymax(c*2,l,mid),querymax(c*2+1,mid+1,r)); } public: void build(int n,int *b){ For(i,1,n){ a[i]=b[i]; } build(1,1,n); } int query(int l,int r){ return query(1,l,r); int querymin(int l,int r){ return querymin(1,l,r); } int querymax(int l,int r){ return querymax(1,l,r); }};```
::::::success[线段树 add,cov:$O(n)-O(\log n)$]```cppnamespace SGT{ struct Node{ int l,r; long long sum,add; bool cov; }tr[MAXN*4]; void build(int c,int L,int R){ tr[c].l=L;tr[c].r=R; tr[c].sum=tr[c].add=tr[c].cov=0; if(L==R) return ; int mid=(L+R)>>1; build(c*2,L,mid); build(c*2+1,mid+1,R); } void update(int c){ tr[c].sum=tr[c*2].sum+tr[c*2+1].sum; } void Add(int c,long long k){ tr[c].sum+=k*(tr[c].r-tr[c].l+1); tr[c].add+=k; } void Cov(int c){ tr[c].sum=0; tr[c].add=0; tr[c].cov=1; } void down(int c){ if(tr[c].cov){ Cov(c*2); Cov(c*2+1); tr[c].cov=0; } if(tr[c].add!=0){ Add(c*2,tr[c].add); Add(c*2+1,tr[c].add); tr[c].add=0; } } void add(int c,int l,int r,int k){ if(l==tr[c].l&&r==tr[c].r){ Add(c,k); return ; } down(c); int mid=(tr[c].l+tr[c].r)>>1; if(r<=mid) add(c*2,l,r,k); else if(l>mid) add(c*2+1,l,r,k); else add(c*2,l,mid,k),add(c*2+1,mid+1,r,k); update(c); } void cover(int c,int l,int r){ if(l==tr[c].l&&r==tr[c].r){ Cov(c); return ; } down(c); int mid=(tr[c].l+tr[c].r)>>1; if(r<=mid) cover(c*2,l,r); else if(l>mid) cover(c*2+1,l,r); else cover(c*2,l,mid),cover(c*2+1,mid+1,r); update(c); } long long query(int c,int l,int r){ if(l==tr[c].l&&r==tr[c].r){ return tr[c].sum; } down(c); int mid=(tr[c].l+tr[c].r)>>1; if(r<=mid) return query(c*2,l,r); else if(l>mid) return query(c*2+1,l,r); else return query(c*2,l,mid)+query(c*2+1,mid+1,r); }}```
::::::success[ST 表:$O(n\log n)-O(1)$]```cppclass ST{ private:21 行未改动```
:::
:::success[Four Russian($B=\log n$):严格 $O(n\log\log n)-O(1)$]```cppclass FR1{ private: int sz,bs,L[MAXS],R[MAXS],id[MAXN]; int pre[MAXN],suf[MAXN]; int f[MAXS][MAXK],g[MAXN][MAXT]; public: void build(int n,int *a){ sz=log2(n); if(sz==0) sz=1; bs=n/sz; For(i,1,bs-1){ L[i]=(i-1)*sz+1; R[i]=i*sz; } L[bs]=(bs-1)*sz+1;R[bs]=n; For(i,1,bs){ f[i][0]=inf; For(j,L[i],R[i]){ id[j]=i; f[i][0]=min(f[i][0],a[j]); g[j][0]=a[j]; } For(k,1,MAXT-1){ For(l,L[i],R[i]-(1<<k)+1){ g[l][k]=min(g[l][k-1],g[l+(1<<(k-1))][k-1]); } } pre[L[i]]=a[L[i]]; For(j,L[i]+1,R[i]){ pre[j]=min(pre[j-1],a[j]); } suf[R[i]]=a[R[i]]; dFor(j,R[i]-1,L[i]){ suf[j]=min(suf[j+1],a[j]); } } For(j,1,MAXK-1){ For(i,1,bs-(1<<j)+1){ f[i][j]=min(f[i][j-1],f[i+(1<<(j-1))][j-1]); } } } int query(int l,int r){ if(id[l]==id[r]){ int x=log2(r-l+1); return min(g[l][x],g[r-(1<<x)+1][x]); } int ans=min(suf[l],pre[r]); l=id[l]+1;r=id[r]-1; if(l>r) return ans; int x=log2(r-l+1); return min(ans,min(f[l][x],f[r-(1<<x)+1][x])); }};```
:::
:::success[Four Russian($B=\sqrt n$):期望 $O(n)-O(1)$]```cppclass FR2{ private:6 行未改动 For(i,1,n){ a[i]=b[i]; } For(i,1,bs){ Min[i]=2147483647; For(j,L[i],R[i]){ Min[i]=min(Min[i],a[j]); id[j]=i; }272 行未改动全部展开 return a[x]+lzy[id[x]]; }};```
:::
:::success[分块(区间覆盖,单点查询):$O(n)-O(\sqrt n)-O(1)$]```cppclass Block5{ private: int bs,sz,L[MAXM],R[MAXM],id[MAXN]; int a[MAXN],cov[MAXM]; void down(int c){ if(cov[c]!=-1){ For(i,L[c],R[c]){ a[i]=cov[c]; } cov[c]=-1; } } public: void build(int n,int *t){ For(i,1,n){ a[i]=t[i]; } sz=sqrt(n);bs=n/sz; For(i,1,bs-1){ L[i]=(i-1)*sz+1; R[i]=i*sz; } L[bs]=(bs-1)*sz+1;R[bs]=n; For(i,1,bs){ For(j,L[i],R[i]){ id[j]=i; } cov[i]=-1; } } void cover(int l,int r,int k){ if(id[l]==id[r]){ down(id[l]); For(i,l,r){ a[i]=k; } return ; } down(id[l]); For(i,l,R[id[l]]){ a[i]=k; } down(id[r]); For(i,L[id[r]],r){ a[i]=k; } For(i,id[l]+1,id[r]-1){ cov[i]=k; } } int query(int x){ if(cov[id[x]]!=-1) return cov[id[x]]; else return a[x]; }};```
:::
:::success[树状数组(区间加,区间和):$O(n\log n)/O(n)-O(\log n)-O(\log n)$]```cppclass Bit3{ private:113 行未改动全部展开 }};```:::一些神秘 Trick::::success[LCT:$O(n)-O(\log n)$]```cpp#include<bits/stdc++.h>#define For(i,j,k) for(int i=j;i<=k;i++)#define dFor(i,j,k) for(int i=j;i>=k;i--)using namespace std;#define MAXN 10005#define ls son[0]#define rs son[1]#define endl '\n'int n,q;struct Node{ int son[2],fa; bool rev;}tr[MAXN];bool dir(int x){ return tr[tr[x].fa].rs==x;}bool isroot(int x){ return tr[tr[x].fa].son[dir(x)]!=x;}void rev(int x){ if(!x) return ; swap(tr[x].ls,tr[x].rs); tr[x].rev^=1;}void pushdown(int x){ if(tr[x].rev){ rev(tr[x].ls); rev(tr[x].rs); tr[x].rev=0; }}void rotate(int x){ int y=tr[x].fa,z=tr[y].fa; bool r=dir(x); if(!isroot(y)) tr[z].son[dir(y)]=x; tr[y].son[r]=tr[x].son[!r]; tr[x].son[!r]=y; if(tr[y].son[r]) tr[tr[y].son[r]].fa=y; tr[y].fa=x; tr[x].fa=z;}int st[MAXN],top=0;void splay(int x){ top=0; int u=x; st[++top]=u; while(!isroot(u)){ u=tr[u].fa; st[++top]=u; } dFor(i,top,1){ pushdown(st[i]); } while(!isroot(x)){ int y=tr[x].fa; if(!isroot(y)){ rotate(dir(x)==dir(y)?y:x); } rotate(x); }}void access(int x){ int y=0; while(x){ splay(x); tr[x].son[1]=y; y=x; x=tr[x].fa; }}void makeroot(int x){ access(x); splay(x); rev(x);}void link(int x,int y){ makeroot(x); tr[x].fa=y;}int findroot(int x){ access(x); splay(x); pushdown(x); while(tr[x].ls){ x=tr[x].ls; pushdown(x); } splay(x); return x;}void cut(int x,int y){ makeroot(x); findroot(y); tr[x].rs=tr[y].fa=0;}int main(){ ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); cin>>n>>q; while(q--){ string op; int x,y; cin>>op>>x>>y; if(op=="Connect"){ link(x,y); }else if(op=="Destroy"){ cut(x,y); }else{ if(findroot(x)==findroot(y)) cout<<"Yes"<<endl; else cout<<"No"<<endl; } } return 0;}```
1.分块建线段树,树高降为 $\log\sqrt n=\frac{\log n}{2}$,常数 $\frac{1}{2}$,详见 [P5386 [Cnoi2019] 数字游戏](https://www.luogu.com.cn/problem/P5386)。::::::success[Dinic:$O(n^2m)$]```cppclass Dinic{ private: struct Edge{ int to,rev; long long cap; }; int n; vector<vector<Edge>> g; vector<int> dis,it; bool bfs(int s,int t){ fill(dis.begin(),dis.end(),0); queue<int> q; dis[s]=1; q.push(s); while(!q.empty()){ int u=q.front(); q.pop(); for(auto &e:g[u]){ if(!dis[e.to]&&e.cap>0){ dis[e.to]=dis[u]+1; q.push(e.to); } } } return dis[t]!=0; } long long dfs(int u,int t,long long f){ if(u==t) return f; for(int &i=it[u];i<(int)g[u].size();i++){ Edge &e=g[u][i]; if(e.cap<=0) continue; if(dis[e.to]!=dis[u]+1) continue; long long push=dfs(e.to,t,min(f,e.cap)); if(push>0){ e.cap-=push; g[e.to][e.rev].cap+=push; return push; } } return 0; } public: Dinic(int n=0):n(n){ g.assign(n+1,{}); dis.assign(n+1,{}); it.assign(n+1,{}); } void add(int u,int v,long long w){ int szu=g[u].size(),szv=g[v].size(); g[u].push_back({v,szv,w}); g[v].push_back({u,szu,0}); } long long maxflow(int s,int t){ const long long inf=(1ll<<60); long long flow=0; while(bfs(s,t)){ fill(it.begin(),it.end(),0); while(1){ long long push=dfs(s,t,inf); if(!push) break; flow+=push; } } return flow; }};```::::::success[Math]```cppinline int md(int x){ if(x>=Mod) return x-Mod; else return x;}int f[MAXN],g[MAXN];int Pow(int x,int y){ int ans=1; while(y){ if(y&1){ ans=1ll*ans*x%Mod; } x=1ll*x*x%Mod; y>>=1; } return ans;}void init(){ f[0]=1; For(i,1,1000000){ f[i]=1ll*f[i-1]*i%Mod; } g[1000000]=Pow(f[1000000],Mod-2); dFor(i,1000000-1,0){ g[i]=1ll*g[i+1]*(i+1)%Mod; }}inline int C(int n,int m){ if(m>n) return 0; else return 1ll*f[n]*g[m]%Mod*g[n-m]%Mod;}```::::::success[FastIO]```cppstruct IO {#define MAXSIZE (1 << 20)#define isdigit(x) (x >= '0' && x <= '9') char buf[MAXSIZE], *p1, *p2; char pbuf[MAXSIZE], *pp;#if DEBUG#else IO() : p1(buf), p2(buf), pp(pbuf) {}
2.树形 dp 建树状数组,时间复杂度 $O(n)$,详见 [OI Wiki](https://oi.wiki/ds/fenwick/#tricks)。 ~IO() { fwrite(pbuf, 1, pp - pbuf, stdout); }#endif char gc() {#if DEBUG // ??,????? return getchar();#endif if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, MAXSIZE, stdin); return p1 == p2 ? ' ' : *p1++; }
3.$O(n)-O(1)$ 求 RMQ,详见 [P3793 由乃救爷爷](https://www.luogu.com.cn/problem/P3793)。::::::::::::error[我犯过的各种唐诗错误] void read(int &x) { bool neg = false; x = 0; char ch = gc(); for (; !isdigit(ch); ch = gc()) if (ch == '-') neg = true; if (neg) for (; isdigit(ch); ch = gc()) x = x * 10 + ('0' - ch); else for (; isdigit(ch); ch = gc()) x = x * 10 + (ch - '0'); }
void read(char *s) { char ch = gc(); for (; isspace(ch); ch = gc()); for (; !isspace(ch); ch = gc()) *s++ = ch; *s = 0; }
void read(char &c) { for (c = gc(); isspace(c); c = gc()); }
void push(const char &c) {#if DEBUG // ??,????? putchar(c);#else if (pp - pbuf == MAXSIZE) fwrite(pbuf, 1, MAXSIZE, stdout), pp = pbuf; *pp++ = c;#endif }
void write(long long x) { bool neg = false; if (x < 0) { neg = true; push('-'); } static int sta[40]; int top = 0; do { sta[top++] = x % 10; x /= 10; } while (x); if (neg) while (top) push('0' - sta[--top]); else while (top) push('0' + sta[--top]); }
void write(long long x, char lastChar) { write(x), push(lastChar); }} io;```
:::::::::::warning[错题本]
:::info[总结贴]https://www.luogu.com.cn/discuss/1226443 (駄作卡常)
https://www.luogu.com.cn/discuss/1228163 (天降之物卡常)
https://www.luogu.com.cn/discuss/1264621 (D2T2 卡常)
https://www.luogu.com.cn/discuss/1264038 (一切 Ynoi 的终极解决方法):::
:::error[1.其他][https://www.luogu.com.cn/discuss/1199853](https://www.luogu.com.cn/discuss/1199853)(点分治找了树的中心而不是重心)https://www.luogu.com.cn/discuss/1199853 (点分治找了树的中心而不是重心)
[https://www.luogu.com.cn/discuss/1196388](https://www.luogu.com.cn/discuss/1196388)(李超线段树的构造函数写错)https://www.luogu.com.cn/discuss/1196388 (李超线段树的构造函数写错)
[https://www.luogu.com.cn/discuss/1168371](https://www.luogu.com.cn/discuss/1168371)(链长为 1 的树剖)https://www.luogu.com.cn/discuss/1222937 (01 bfs 写错)
https://www.luogu.com.cn/discuss/1227360 (线段树分治回滚顺序反了)
https://www.luogu.com.cn/discuss/1227364 (题目读错+并查集写错)
https://www.luogu.com.cn/discuss/1227812 (线段树没判区间是否存在导致 TLE)
https://www.luogu.com.cn/discuss/1230198 (犯唐)
https://www.luogu.com.cn/discuss/1233180 (退化成暴力没发现)
https://www.luogu.com.cn/discuss/1233487 (FWT 不能定长变换)
https://www.luogu.com.cn/discuss/1233730 (无序对转有序对)
https://www.luogu.com.cn/discuss/1233893 (有关卡空间)
https://www.luogu.com.cn/discuss/1281663 (爆精度)
https://www.luogu.com.cn/discuss/1278162 ($0$ 号节点未初始化)
https://www.luogu.com.cn/discuss/1259621 (segment tree beats)
https://www.luogu.com.cn/discuss/1253997 (犯唐)
https://www.luogu.com.cn/discuss/1253194 (全局变量被覆盖)
https://www.luogu.com.cn/discuss/1241561 (并查集)
https://www.luogu.com.cn/discuss/1241092 (忘记特判)
https://www.luogu.com.cn/discuss/1236301 (犯唐):::
:::error[2.数组开小了]
[https://www.luogu.com.cn/discuss/1213198](https://www.luogu.com.cn/discuss/1213198)(总结帖)https://www.luogu.com.cn/discuss/1213198 (总结帖)
[https://www.luogu.com.cn/discuss/1216822](https://www.luogu.com.cn/discuss/1216822)(dfn 序 2 倍空间)https://www.luogu.com.cn/discuss/1216822 (dfn 序 2 倍空间)
[https://www.luogu.com.cn/discuss/1214457](https://www.luogu.com.cn/discuss/1214457)(值域分块加 eps 空间)https://www.luogu.com.cn/discuss/1214457 (值域分块加 eps 空间)
[https://www.luogu.com.cn/discuss/1211041](https://www.luogu.com.cn/discuss/1211041)(主席树 256 倍空间)https://www.luogu.com.cn/discuss/1211041 (主席树 256 倍空间)
[https://www.luogu.com.cn/discuss/1210711](https://www.luogu.com.cn/discuss/1210711)(数组恰好越界到其他数组)https://www.luogu.com.cn/discuss/1210711 (数组恰好越界到其他数组)
[https://www.luogu.com.cn/discuss/1209765](https://www.luogu.com.cn/discuss/1209765)(动态开点线段树 64 倍空间)https://www.luogu.com.cn/discuss/1209765 (动态开点线段树 64 倍空间)
[https://www.luogu.com.cn/discuss/1209764](https://www.luogu.com.cn/discuss/1209764)(线段树 4 倍空间)https://www.luogu.com.cn/discuss/1209764 (线段树 4 倍空间)
[https://www.luogu.com.cn/discuss/1195485](https://www.luogu.com.cn/discuss/1195485)(值域是 $10^5+1$)https://www.luogu.com.cn/discuss/1195485 (值域是 $10^5+1$)
[https://www.luogu.com.cn/discuss/1170012](https://www.luogu.com.cn/discuss/1170012)(数组开小了)https://www.luogu.com.cn/discuss/1170012 (数组开小了)
https://www.luogu.com.cn/discuss/1225361 (阈值错误导致爆数组越界)
https://www.luogu.com.cn/discuss/1256701 (懒标记忘记处理)
:::
:::error[3.答案爆 int][https://www.luogu.com.cn/discuss/1213674](https://www.luogu.com.cn/discuss/1213674):::error[3.爆 int]https://www.luogu.com.cn/discuss/1213674
[https://www.luogu.com.cn/discuss/1196644](https://www.luogu.com.cn/discuss/1196644)https://www.luogu.com.cn/discuss/1196644
[https://www.luogu.com.cn/discuss/1163160](https://www.luogu.com.cn/discuss/1163160)https://www.luogu.com.cn/discuss/1163160
[https://www.luogu.com.cn/discuss/1222206](https://www.luogu.com.cn/discuss/1222206)https://www.luogu.com.cn/discuss/1222206
https://www.luogu.com.cn/discuss/1279500
https://www.luogu.com.cn/discuss/1261682
https://www.luogu.com.cn/discuss/1261173
https://www.luogu.com.cn/discuss/1251808:::
:::error[4.FHQ-Treap][https://www.luogu.com.cn/discuss/1218620](https://www.luogu.com.cn/discuss/1218620)(错误的 build)https://www.luogu.com.cn/discuss/1218620 (错误的 build)
[https://www.luogu.com.cn/discuss/1215031](https://www.luogu.com.cn/discuss/1215031)(小于等于)https://www.luogu.com.cn/discuss/1215031 (小于等于)
[https://www.luogu.com.cn/discuss/1199853](https://www.luogu.com.cn/discuss/1199853)(小于等于)https://www.luogu.com.cn/discuss/1199853 (小于等于)
[https://www.luogu.com.cn/discuss/1222051](https://www.luogu.com.cn/discuss/1222051)(split 顺序错误)https://www.luogu.com.cn/discuss/1222051 (split 顺序错误):::
:::error[5.位运算][https://www.luogu.com.cn/discuss/1195641](https://www.luogu.com.cn/discuss/1195641)(位运算没加括号)https://www.luogu.com.cn/discuss/1195641 (位运算没加括号)
[https://www.luogu.com.cn/discuss/1217035](https://www.luogu.com.cn/discuss/1217035)(理解不深入)https://www.luogu.com.cn/discuss/1217035 (理解不深入):::
:::error[5.多测不清空][https://www.luogu.com.cn/discuss/1166700](https://www.luogu.com.cn/discuss/1166700)https://www.luogu.com.cn/discuss/1166700
[https://www.luogu.com.cn/discuss/1222284](https://www.luogu.com.cn/discuss/1222284)(cdq 分治错误清空)https://www.luogu.com.cn/discuss/1222284 (cdq 分治错误清空)
https://www.luogu.com.cn/discuss/1222813 (还是 cdq 分治)
https://www.luogu.com.cn/discuss/1233181 (线段树优化建图):::
:::error[6.while 写成 if][https://www.luogu.com.cn/discuss/1165825](https://www.luogu.com.cn/discuss/1165825)https://www.luogu.com.cn/discuss/1165825:::
:::error[7.动态树][https://www.luogu.com.cn/discuss/1220390](https://www.luogu.com.cn/discuss/1220390)(LCT isroot 写错)https://www.luogu.com.cn/discuss/1220390 (LCT isroot 写错)
[https://www.luogu.com.cn/discuss/1221868](https://www.luogu.com.cn/discuss/1221868)(splay 忘记全部 pushdown)https://www.luogu.com.cn/discuss/1221868 (splay 忘记全部 pushdown)
[https://www.luogu.com.cn/discuss/1221879](https://www.luogu.com.cn/discuss/1221879)(LCT cut 写错)https://www.luogu.com.cn/discuss/1221879 (LCT cut 写错)
[https://www.luogu.com.cn/discuss/1222205](https://www.luogu.com.cn/discuss/1222205)(静态 Top Tree DAC 写错)https://www.luogu.com.cn/discuss/1222205 (静态 Top Tree DAC 写错)
https://www.luogu.com.cn/discuss/1233183 (Rake/Compress 写错+卡卡就过了)
https://www.luogu.com.cn/discuss/1233475 (Rake/Compress 写错):::
:::error[8.细节问题]https://www.luogu.com.cn/discuss/1224351 (加加减减)
https://www.luogu.com.cn/discuss/1225786 (op=0/1 看错成 op=1/2)
https://www.luogu.com.cn/discuss/1226754 (加加减减)
https://www.luogu.com.cn/discuss/1226793 (小于/小于等于)
https://www.luogu.com.cn/discuss/1227810 (审题不清)
https://www.luogu.com.cn/discuss/1233182 (cdq 分治先修改,再询问)::::::error[9.树剖!!!!!!!!!!]https://www.luogu.com.cn/discuss/1168371 (链长为 1 的树剖)
https://www.luogu.com.cn/discuss/1227112 (神贴):::::::