摘要: #include#include#include#includeusing namespace std;#define maxn 210000int ch[maxn][2],pre[maxn];int siz[maxn];bool rt[maxn];void pushup(int x){ siz[x]=1+siz[ch[x][0]]+siz[ch[x][1]];}void rotate(int x){ int y=pre[x],k=ch[y][0]==x; ch[y][!k]=ch[x][k]; pre[ch[x][k]]=y; pre[x]=pre[y]; pre[y]=x... 阅读全文
posted @ 2014-02-15 21:56 wangyucheng 阅读(134) 评论(0) 推荐(0) 编辑