#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int maxn=1e5+5;
ll fa[maxn][40],depth[maxn];
ll n,m,k;ll pre[maxn];
vector<ll> vec[maxn];
bool vis[maxn];
ll root;
void dfs(ll s,ll step){
depth[s]=step;vis[s]=1;
for(ll i=0;i<vec[s
【图论】倍增法求LCA
最新推荐文章于 2022-01-11 18:24:56 发布