LCA的 RMQ解法模版
摘要:
struct Edge{ int from, to, nex;}edge[Nb?a:b;}int time;int deep[N<<1], index[N<<1], first[N];void DFS(int u, int dep){ deep[time] = u; index[time] =u; time++; for(int i = head[u]; i !=-1; i = edge[i].nex) { int v = edge[i].to; if(first[v] == 0) { first[v] = time; DFS(v, dep+1); deep[time] 阅读全文