您的位置:首页 > 大数据 > 人工智能

【主席树】【线段树】Data Structure Special Training 2 T3 intkth 题解

2017-04-04 21:32 316 查看
Problem 3. intkth

Input file: intkth.in

Output file: intkth.out

Time limit: 3 seconds

Memory limit: 512 MB

我看好你哟。

给你一个长度为n 的序列,有m 个操作:

• modify u x 将第u 个数修改为x

• query l r k 询问区间[l; r] 中第k 小的数1

Input

第1 行2 个整数:n m,表示序列长度和操作数。

第2 行n 个整数:a1 a2 a3 : : : an,表示给定序列。

接下来m 行,每行表示上面的某个操作。

Output

对于每个询问操作,输出其结果。

Sample

intkth.in intkth.out

5 5

5 2 1 3 4

query 1 4 3

modify 4 5

query 1 4 3

modify 1 3

query 1 4 3

353

Note

• 对于30% 的数据,1  n￿m  103

• 对于100% 的数据,1  n￿m  105,1  ai￿u￿x  n,1  k  r
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: