摘要:
#include#include#include#includeusing namespace std;#define maxn 22000int nn,n;int e[maxn],ne[maxn],v[maxn],fa[maxn],w[maxn];void add(int x,int y,int z){ ne[++nn]=e[x],e[x]=nn,v[nn]=y,w[nn]=z; }struct node{ int ch[2],s,val,pre,siz,rt; }t[maxn];#define c(x,y) t[x].ch[y]void up(int x){ t[x].siz=t... 阅读全文