
主席树
Felix-Lee
北有玄武盾,南有雀攻法,东有青龙唾,西有虎焰击,中有沙婆星,层层设备,步步为营。
展开
-
POJ 2104 . K-th Number
POJ 2104 . K-th Number DescriptionYou are working for Macrohard company in data structures department. After failing your previous task about key insertion you were asked to write a new data structure t原创 2017-06-27 21:31:52 · 442 阅读 · 0 评论 -
JZOJ 5710. 【北大夏令营2018模拟5.13】Mex
Description 在组合游戏中计算状态的 SG 值时,我们常常会遇到 mex 函数。mex(S) 的值为集合 S 中没有出现过的最小自然数。例如,mex({1,2}) = 0、mex({0,1,2,3}) = 4。 给定长度为 n 的序列 a。现有 m 次询问,每次给定 l 和 r,询问区间 [l,r] 的数构成的集合的 mex 值。 Input 输入数据的第一行包含三个整数 n...原创 2018-05-14 22:28:05 · 420 阅读 · 0 评论 -
JZOJ 5850. 【NOIP提高组模拟2018.8.25】e
Description Input Output Sample Input 5 7 0 1 2 3 4 5 1 2 2 3 2 4 1 5 1 2 4 5 2 2 4 5 3 2 4 5 4 2 4 5 5 2 4 5 5 1 2 100 3 1 2 5 Sample Output 0 0 1 0 0 3 95 Da...原创 2018-09-03 21:33:34 · 261 阅读 · 0 评论 -
JZOJ 5933. 【NOIP2018模拟10.27】百鸽笼
Description Input 从文件 pigeon.in 中读入数据。 输入第一行包含两个正整数 n, m ,分别表示初始鸽笼数与操作个数。 第二行包含 n 个正整数,第 i 个数表示从左往右第 i 个初始鸽笼中鸽子的咕咕能力值 vi 。 接下去 m 行每行表示一个操作。操作输入格式见题面描述。 Output 输出到文件 pigeon.out 中。 输出包含若干行,每行表示一个相应的 3...原创 2018-10-27 15:46:27 · 339 阅读 · 0 评论