随笔分类 - 数据结构-平衡树
摘要:```cpp include define inf 2147483647 using namespace std; const int N=100010; int ch[N][2],val[N],key[N],sz[N],tot; struct FHQtreap{ int rt,x,y,z; inl
阅读全文
摘要:```cpp #include using namespace std; const int N=100010; int root,tot; int sz[N],val[N],ch[N][2],fa[N]; void pushup(int x){ if(!x)return; sz[x]=1; if(ch[x][0])sz[x]+=sz[ch[x][0]],fa[ch[x][0]]=x;...
阅读全文