![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Splay
ljq真的不能再吃了
珍惜每一天
展开
-
【P3369 普通平衡树】 Splay
P3369 Splay 我的版本一开始是必须要Insert 一个最小值 和一个最大值的 不然前驱后继 k大值会出锅 /* if you can't see the repay Why not just work step by step rubbish is relaxed to ljq */ #include <cstdio> #include <...原创 2019-05-09 13:11:07 · 135 阅读 · 0 评论 -
【P3391 文艺平衡树】 Splay
P3391 维护一个区间 rev 那么就是你先 Splay(l-1) 然后再 Spaly(r+1) 这样的话 区间(l,r) 就在 r+1点的左子树 /* if you can't see the repay Why not just work step by step rubbish is relaxed to ljq */ #include <cstdio...原创 2019-05-09 13:16:46 · 127 阅读 · 0 评论 -
【P2042 [NOI2005]维护数列】Splay
P2042 题意给你6个操作 插入 删除 修改 翻转 求和 求和最大序列 因为涉及区间 所以我们预先放进去 1 这个点 和 arr[n+2] 这个点 相当于把数列右移了 1 单位 这样 l - 1 和 r + 1 就不用担心了 否则需要分类讨论 我们首先看插入 Insert 就是Build 一个新函数 然后插入到 x + 1 位置 删除是同理的 down和up要用线段树类似的维护 区别是线段树不需...原创 2019-05-09 16:27:33 · 98 阅读 · 0 评论 -
LCT 的基础 Splay简单食用指南
我是不会用Splay写平衡树的(真香 为了学LCT 记一份Splay板子 //普通平衡树 /* if you can't see the repay Why not just work step by step rubbish is relaxed to ljq */ #include <cstdio> #include <cstring> ...原创 2019-09-18 19:59:31 · 174 阅读 · 0 评论