洛谷 P1198 [JSOI2008]最大数 题目描述 现在请求你维护一个数列,要求提供以下两种操作: 1. 查询操作. 语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值. 限制: L不超过当前数列的长度. (L>0) 2. 插入操作. 语法:A n 功能:将 n 加上 t ,其中 t 是最近一次查询操作的答案(如果还未执行过查询操作,则 t=0 ),并将所得结果对一个固定的常数 D 取模,将所得答案插入到数列的末尾. 限制: n是整数(可能为负数)并且在长整范围内.…
题目描述 这是一道模板题,其数据比「普通平衡树」更强. 如未特别说明,以下所有数据均为整数. 维护一个多重集 S ,初始为空,有以下几种操作: 把 x 加入 S 删除 S 中的一个 x,保证删除的 x 一定存在 求 S 中第 k 小 求 S 中有多少个元素小于 x 求 S 中小于 x 的最大数 求 S 中大于 x 的最小数 操作共 n 次. 输入格式 第一行一个整数 n,表示共有 n 次操作 . 接下来 n 行,每行为以下几种格式之一 : 0 x,把 x 加入 S 1 x,删除 S 中的一个 x…
题目链接: C. Subsequences time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output For the given sequence with n different elements find the number of increasing subsequences with k + 1 elements. It is…
E. e-Government time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output The best programmers of Embezzland compete to develop a part of the project called "e-Government" — the system of automa…