
数据结构==splay
Helium_wild
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
bzoj3224(普通平衡树 splay板子)
题目 splay #include<cstdio> #include<iostream> using namespace std; const int N=1e5+5; int ch[N][2],f[N],sz[N],cnt[N],val[N]; int tot,root; inline void _clear(int x){ ch[x][0]=ch[x][1]=...原创 2019-07-26 23:06:59 · 198 阅读 · 0 评论 -
bzoj1208(宠物收养所 splay模板)
题目 #include<cstdio> #include<iostream> using namespace std; typedef long long ll; const int N=8e4+5,mod=1e6; const ll INF=1e12; int ch[N][2],f[N],sz[N],cnt[N],val[N],root=0,tot=0; ll a[N]...原创 2019-08-09 15:21:40 · 187 阅读 · 0 评论 -
bzoj1503(郁闷的出纳员 splay模板)
#include<cstdio> #include<iostream> using namespace std; typedef long long ll; const int N=1e5+100+5; int ch[N][2],f[N],sz[N],cnt[N],val[N]; int tot,root; inline void _clear(int x){ ch...原创 2019-08-09 18:40:38 · 133 阅读 · 0 评论 -
bzoj3223(文艺平衡树 splay区间翻转模板)
题目 思路: 以下标建立一颗平衡树。splay之后序列顺序并不改变,就像splay之后不改变数的大小关系。翻转区间[l,r]先把 l-1 翻转到根部,然后把r+1翻转到根部的右儿子。此时根部右儿子的左儿子就是区间[l,r]。此时对这个区间tag[ch[ch[root][1]][0]]^=1; 每次route的时候需要pushdown(f[x]),pushdown(x). 将l-1旋转到根部的操作是...原创 2019-08-14 17:24:49 · 243 阅读 · 4 评论