
Splay
YOONGI
这个作者很懒,什么都没留下…
展开
-
POJ - 2828 Buy Tickets (Splay)
Buy TicketsRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little C...原创 2019-08-14 10:13:38 · 230 阅读 · 0 评论 -
POJ - 3481 Double Queue (Splay)
Double QueueAfter Handsome Qw Chen graduated from college, he went to work in a bank.There are too many people waiting in line at the bank every day, so H.Q.Chen has a lot of trouble.One day, d...原创 2019-08-13 11:38:15 · 170 阅读 · 0 评论 -
Splay详解
原文链接:https://blog.youkuaiyun.com/Clove_unique/article/details/50630280变量声明:f[i]表示i的父结点,ch[i][0]表示i的左儿子,ch[i][1]表示i的右儿子,key[i]表示i的关键字(即结点i代表的那个数字),cnt[i]表示i结点的关键字出现的次数(相当于权值),size[i]表示包括i的这个子树的大小;sz为整棵树的大小...转载 2019-08-13 10:26:44 · 351 阅读 · 0 评论 -
Tyvj 1728 普通平衡树 (Splay)
Tyvj 1728 普通平衡树您需要写一种数据结构(可参考题目标题),来维护一些数,其中需要提供以下操作:1. 插入x数2. 删除x数(若有多个相同的数,因只删除一个)3. 查询x数的排名(若有多个相同的数,因输出最小的排名)4. 查询排名为x的数5. 求x的前驱(前驱定义为小于x,且最大的数)6. 求x的后继(后继定义为大于x,且最小的数)Input第一行为n,表示操作的...原创 2019-08-13 10:37:22 · 203 阅读 · 0 评论