当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6231:K-th Number

题目描述
Alice are given an array $A[1..N]$ with $N$ numbers.

Now Alice want to build an array $B$ by a parameter $K$ as following rules:

Initially, the array B is empty. Consider each interval in array A. If the length of this interval is less than $K$, then ignore this interval. Otherwise, find the $K$-th largest number in this interval and add this number into array $B$.

In fact Alice doesn't care each element in the array B. She only wants to know the $M$-th largest element in the array $B$. Please help her to find this number.
输入解释
The first line is the number of test cases.

For each test case, the first line contains three positive numbers $N(1 \leq N \leq 10^5), K(1 \leq K \leq N), M$. The second line contains $N$ numbers $A_i (1 \leq A_i \leq 10^9)$.

It's guaranteed that M is not greater than the length of the array B.
输出解释
For each test case, output a single line containing the $M$-th largest element in the array $B$.
输入样例
2
5 3 2
2 3 1 5 4
3 3 1
5 8 2
输出样例
3
2
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6231

最后修改于 2020-10-25T23:29:31+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)