题目来源
洛谷P3379【模板】最近公共祖先(LCA)
https://daniu.luogu.org/problem/show?pid=3379
蒟蒻代码(C++)
#include <cmath>
#include <cstdio>
#include <bitset>
using namespace std;
bitset<500010> g;
int he[5000010],en[5000010],ne[5000010];
int f[5000010][20],fi[5000010];
int n,m,s,x,y,cnt=0,de[5000010],euler[5000010];
inline void add();
inline int read();
int lca(int x,int y);
void dfs(int pos,int depth);
int main()
{
n=read();