随笔分类 -  数据结构——平衡树

摘要:LCT 对 LCT 有了更深的理解 参考 FlashHu Statement 有 \(n\) 棵树,初始各有 \(1\) 个编号为 \(1\) 的节点,称它们为生长节点。 \(m\) 个操作,\(3\) 种之一: \(0\ l\ r\) 将 \([l,r]\) 区间内的树的生长节点加一个编号相同的儿 阅读全文
posted @ 2022-02-22 17:10 _Famiglistimo 阅读(70) 评论(1) 推荐(1)
摘要:LCT Statement 一颗节点数为 \(3n+1\) 的树,编号在 \(1 \dots n\) 的节点有且仅有三个儿子。 其余点没有儿子。所有节点值只可能为 \(0\) 或 $ 1$,编号在 \(n + 1 \dots 3n\) 的节点的值由输入确定,编号在 $ 1 \to n$ 的节点的值为 阅读全文
posted @ 2022-02-20 20:12 _Famiglistimo 阅读(136) 评论(0) 推荐(1)
摘要:#include<bits/stdc++.h> using namespace std; const int maxn = 1e5+5; const int INF = 1e9; struct node{ node *ch[2]; int val,size; node(int v=0,int siz 阅读全文
posted @ 2021-02-17 10:38 _Famiglistimo 阅读(89) 评论(0) 推荐(0)
摘要:普通平衡树: #include<bits/stdc++.h> using namespace std; const int maxn = 1e5+5; const int INF = 1e9; class Splay{ #define root t[0].son[1] private: struct 阅读全文
posted @ 2020-12-28 19:57 _Famiglistimo 阅读(130) 评论(0) 推荐(0)
摘要:普通平衡树: #include<bits/stdc++.h> using namespace std; const int maxn=1e5+5; struct FHQ_Treap{ protected: struct node{ node *ch[2]; int siz,val,key; node 阅读全文
posted @ 2020-12-19 13:07 _Famiglistimo 阅读(86) 评论(0) 推荐(0)
摘要:#include<vector> using namespace std; namespace Scapegoat_Tree{ #define MAXN (100000 + 10) const double alpha = 0.75; struct Node{ Node * ch[2]; int k 阅读全文
posted @ 2020-12-12 12:36 _Famiglistimo 阅读(128) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> #define val(rt) t[rt].val #define dat(rt) t[rt].dat #define cnt(rt) t[rt].cnt #define size(rt) t[rt].size #define l(rt) t[rt]. 阅读全文
posted @ 2020-11-24 22:22 _Famiglistimo 阅读(153) 评论(0) 推荐(0)