
数据结构
Hello_BABY_OvO
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj2892(treap)
poj2892(treap)我用的是treap操作的 每一次把被摧毁的村庄放进treap中,然后找到查询点的前驱和后继就是改联通块的起始点和终止点,之后每个联通块中村庄的个数也就知道了,每次修复时将这个村庄从treap中删除即可。#include<iostream>#include<cstdio>#include<cstdlib>using namespace std;int n,m;i原创 2017-12-21 21:34:11 · 315 阅读 · 0 评论 -
BZOJ3196 二逼平衡树
线段树套平衡树因为线段树支持区间修改查询,平衡树支持查询第k大,一个数的排名,一个数的前驱、后继。所以选择两个数据结构套在一起。#include<iostream>#include<cstdlib>#include<cstdio>using namespace std;int n,m,sz,tmp;int a[200005],root[200005];struct Tree{原创 2017-12-25 14:18:25 · 289 阅读 · 0 评论 -
BZOJ3224 普通平衡树
treap模板。。。没啥好说的啊。。。#include<iostream>#include<cstdio>#include<cstdlib>using namespace std;int m,sz,root,tmp;struct Tree{ int l,r; int num,rnd,w,s;}tree[400005];void update(int t){原创 2017-12-25 16:12:59 · 274 阅读 · 0 评论