A. The kth great number

    传统题 1000ms 256MiB

The kth great number

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

题目描述

Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number written by Xiao Ming is too much, Xiao Bao is feeling giddy. Now, try to help Xiao Bao.

翻译:给你一堆数你告诉我第K大的数就行了

输入格式

The first line of input contains two positive integer n, k. Then n lines follow. If Xiao Ming choose to write down a number, there will be an " I" followed by a number that Xiao Ming will write down. If Xiao Ming choose to ask Xiao Bao, there will be a "Q", then you need to output the kth great number. Xiao Ming won't ask Xiao Bao the kth great number when the number of the written number is smaller than k.

翻译:第一行两个数n,k(1kn1000000)n,k(1\leq k\leq n\leq1000000).,接下来n行每行一个操作,如果是'I'表示插入一个数,如果是'Q'表示询问第k大的数。

保证数据合法就是当前数量比k小时不会询问。

输出格式

The output consists of one integer representing the largest number of islands that all lie on one line.

翻译:每次询问输出第K大的数,每次输出占一行

样例

8 3
I 1
I 2
I 3
Q
I 5
Q
I 4
Q
1
2
3

Level-4期中测试赛

未参加
状态
已结束
规则
IOI
题目
5
开始于
2024-8-3 16:00
结束于
2024-8-3 19:00
持续时间
3 小时
主持人
参赛人数
11