http://www.lydsy.com/JudgeOnline/problem.php?id=2286 题意:n个点的边加权树,m个询问,每次询问给出的k个点与结点1分离的最小代价.(n<=250000, sum{ki}<=500000) #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N=250005, oo=0x7f7f7f7f; int dep[N], FF[N],…
#include<cstdio> #include<iostream> #define M 1000009 #define N 250009 #define ll long long #define inf 1000000000000000000LL #include<algorithm> using namespace std; ],deep[N],m,h[N],dfn[N],TI,cnt1,zhan[N],tot,head1[N]; int next1[M],u1[…