1814: 【CSP数组】寻找第K大数▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:11 Solved:5

Description

N 个小朋友在一起做游戏。 每个小朋友在自己的硬纸板上写一个数,然后同时举起来。 接着,小 lns="http://www.w3.org/1998/Math/MathML">y 老师提一个问题,看哪个小朋友先抢答出来。

问题是,在这 lns="http://www.w3.org/1998/Math/MathML">N 个数中,第 lns="http://www.w3.org/1998/Math/MathML">K 大的是哪个数?请你编程完成。

Input

输入文件的第一行为 lns="http://www.w3.org/1998/Math/MathML">2 个整数,依次为 lns="http://www.w3.org/1998/Math/MathML">N 和 lns="http://www.w3.org/1998/Math/MathML">K ( lns="http://www.w3.org/1998/Math/MathML">KN1000 );

下面 lns="http://www.w3.org/1998/Math/MathML">N 行,每行为一个整数,表示从第 lns="http://www.w3.org/1998/Math/MathML">1 个小朋友到第 lns="http://www.w3.org/1998/Math/MathML">N 个朋友分别写的数(假设这些小朋友只知道 lns="http://www.w3.org/1998/Math/MathML">3276832767 之间的数)。

Output

输出文件只有一行,就一个数,为第 lns="http://www.w3.org/1998/Math/MathML">K 大的那个数

Sample Input Copy

5 2
7 1 9 8 6

Sample Output Copy

8

HINT

注意:本题第 lns="http://www.w3.org/1998/Math/MathML">2 大的数是 lns="http://www.w3.org/1998/Math/MathML">2 ,第 lns="http://www.w3.org/1998/Math/MathML">3 大的数也是 lns="http://www.w3.org/1998/Math/MathML">2 ,第 lns="http://www.w3.org/1998/Math/MathML">4 大的数是 lns="http://www.w3.org/1998/Math/MathML">1