/* I will wait for you */
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<iostream>
#include<fstream>
#include<vector>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<string>
#define make make_pair
#define fi first
#define se second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
const int maxn=1000010;
const int maxm=1010;
const int maxs=26;
const int INF=1<<29;
const int P=1000000007;
const double error=1e-9;
struct edge{ int v,w,next; }e[maxn];
int n,cnt=0,head[maxn];
LL sum=0,fin=(LL)INF*INF,size[maxn],ans[maxn],c[maxn];
void add(int u,int v,int w)
{
e[cnt]=(edge){v,w,head[u]};head[u]=cnt++;
e[cnt]=(edge){u,w,head[v]};head[v]=cnt++;
}
void d
BZOJ1827【Tree DP】
最新推荐文章于 2018-11-20 20:54:07 发布