随笔分类 -  数据结构

摘要:1 struct Splay{ 2 struct obj{ 3 int s,v,cnt; 4 obj*f,*c[2]; 5 obj(int _v=0,int _cnt=0,obj*_f=null): 6 v... 阅读全文
posted @ 2015-09-05 14:22 Mite 阅读(124) 评论(0) 推荐(0)
摘要:1 struct splay_node { 2 splay_node *left, *right; 3 int value; 4 }; 5 int size; 6 7 splay_node* splay(splay_node* a, int v) { 8 ... 阅读全文
posted @ 2015-08-21 11:18 Mite 阅读(130) 评论(0) 推荐(0)
摘要:虽然是区间修改,但是还没有加lazy标记.线段树的树套树还是需要多仔细理解下.先放一个基本版本了...以后再把lazy标记也加上. 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #in... 阅读全文
posted @ 2015-05-14 21:19 Mite 阅读(390) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #in... 阅读全文
posted @ 2015-04-26 16:11 Mite 阅读(281) 评论(0) 推荐(0)
摘要:1 struct node { 2 int l, r; 3 int lazy; 4 LL sum; 5 LL add; 6 }tree[MAXN]; 7 int a[100005]; 8 void build(int v, int l, int r) { 9 ... 阅读全文
posted @ 2015-04-10 23:25 Mite 阅读(132) 评论(0) 推荐(0)
摘要:1 struct treap_node { 2 treap_node *left, *right; 3 int value, fix, size; 4 }; 5 6 void treap_maintain(treap_node* a) { 7 a->size... 阅读全文
posted @ 2015-03-27 23:08 Mite 阅读(166) 评论(0) 推荐(0)