H. Crystalfly(2021ICPC-南京)(树状dp)
The 2021 ICPC Asia Nanjing Regional Contest参考题解比赛题解SolutionCodeconst int N = 2e5 + 5;ll sum[N], f[N], a[N], t[N];vector<int> v[N];void dfs(int x, int fa){ multiset<ll>s;//set中根节点是集合最小值 ll maxn = 0; for (int y : v[x]) { i