正文
增加 3 行删除 3 行
39 行未改动4041424344454647485 行未改动54555657585960616256 行未改动119120121122123124125126127219 行未改动全部展开39 行未改动这样单次查询的时间复杂度就是严格 $\mathcal{O}(1)$ 了。实现有一定量的细节。```cpp#include<bits/stdc++.h>#define rd read()#define gc getchar()using namespace std;inline int read(){5 行未改动const int N=500005;unsigned s;long long out;inline unsigned get(unsigned x) {x^=x<<13,x^=x>>17,x^=x<<5;return s=x;}int n,q,rt,cnt;int dep[N],mx[N],son[N],dfn[N],rev[N],top[N],lg[N],f[20][N];vector<int> v[N],up[N];56 行未改动故算法的时空复杂度为 $\mathcal{O}(n)$。```cpp#include<bits/stdc++.h>#define rd read()#define gc getchar()using namespace std;inline int read(){219 行未改动全部展开39 行未改动4041424344454647485 行未改动54555657585960616256 行未改动119120121122123124125126127219 行未改动全部展开39 行未改动这样单次查询的时间复杂度就是严格 $\mathcal{O}(1)$ 了。实现有一定量的细节。```cpp#include<bits/stdc++.h>#define rd read()#define gc getchar()using namespace std;inline int read(){5 行未改动const int N=500005;unsigned s;long long out;inline unsigned get(unsigned x) {x^=x<<13,x^=x>>17,x^=x<<5;return s=x;}int n,q,rt,cnt;int dep[N],mx[N],son[N],dfn[N],rev[N],top[N],lg[N],f[20][N];vector<int> v[N],up[N];56 行未改动故算法的时空复杂度为 $\mathcal{O}(n)$。```cpp#include<bits/stdc++.h>#define rd read()#define gc getchar()using namespace std;inline int read(){219 行未改动全部展开