http://www.lydsy.com/JudgeOnline/problem.php?id=4034 dfs序,树链剖分 #include<cstdio> #include<iostream> using namespace std; #define N 100001 typedef long long LL; int n,a[N]; ],to[N<<],tot; int fa[N],siz[N],dep[N]; int bl[N]; int id,L[N],R[N…
http://www.lydsy.com/JudgeOnline/problem.php?id=1036 树链剖分板子题 #include<cstdio> #include<iostream> #include<algorithm> #define N 30001 using namespace std; ],nxt[N<<],tot; int n,val[N]; int siz[N],fa[N],dep[N]; int id[N],dy[N],bl[N];…