
平衡树
dxyinme
这个作者很懒,什么都没留下…
展开
-
[codevs2573/洛谷P1801]黑匣子
题目描述: 我们使用黑匣子的一个简单模型。它能存放一个整数序列和一个特别的变量i。在初始时刻,黑匣子为空且i等于0。这个黑匣子能执行一系列的命令。有两类命令: ADD(x):把元素x放入黑匣子; GET:把i加1的同时,输出黑匣子内所有整数中第i小的数。牢记第i小的数是当黑匣子中的元素已非降序排序后位于第i位的元素。现需要一个有效的算法处理给定的一系列命令。ADD和GET命令的总数至多个有30原创 2016-08-09 14:43:11 · 1367 阅读 · 0 评论 -
[UESTC 1061]秋实大哥与战争
男儿何不带吴钩,收取关山五十州。 征战天下是秋实大哥一生的梦想,所以今天他又在练习一个对战游戏。 秋实大哥命令所有士兵从左到右排成了一行来抵挡敌人的攻击。 敌方每一次会攻击一个士兵,这个士兵就会阵亡,整个阵列就会从这个位置断开;同时有的时候已阵亡的士兵会受人赢气息感染而复活。 秋实大哥想知道某一时刻某一个士兵所在的阵列的长度是多少。 Input第一行包含两个整数n,m,表示秋实大哥的士兵数原创 2016-10-03 10:53:21 · 460 阅读 · 0 评论 -
[模板]平衡树treap
#include<cstdlib>#include<cstring>#include<cstdio>#include<iostream>#include<algorithm>#include<ctime>#include<queue>#define LiangJiaJun mainusing namespace std;int l[1000004],r[1000004],s[100原创 2017-11-20 20:17:53 · 242 阅读 · 0 评论 -
[codeforces]514C
C. Watto and Mechanism time limit per test:3 seconds memory limit per test:256 megabytesWatto, the owner of a spare parts store, has recently got an order for the mechanism that can process strings i原创 2017-12-01 18:39:38 · 444 阅读 · 0 评论 -
[模板]splay
[bzoj3224]普通平衡树#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#define LiangJiaJun mainusing namespace std;int f[100004],ch[100004][2],key[10000...原创 2018-08-08 10:54:24 · 122 阅读 · 0 评论 -
[codeforces1061D]TV Shows
time limit per test : 2 secondsmemory limit per test : 256 megabytesThere are nnn TV shows you want to watch. Suppose the whole time is split into equal parts called “minutes”. The i-th of the shows...原创 2018-11-25 01:34:20 · 1003 阅读 · 0 评论