https://www.luogu.org/problemnew/show/P2486 值的一看https://www.cnblogs.com/Tony-Double-Sky/p/9283262.html #include<bits/stdc++.h> using namespace std; ; vector<int>G[maxn]; int n , q ,cnt; int siz[maxn] , wson[maxn],dep[maxn],fa[maxn],top[maxn],p…
链接:https://ac.nowcoder.com/acm/contest/886/J来源:牛客网 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 Rowlet is playing a very popular game in the pokemon world. Recently, he has encountered a problem and wants to ask for…