1120: 求第k大的数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:4 Solved:2

Description

给定一个长度为n(1≤n≤1,000,000)的无序正整数序列,以及另一个数k(1≤k≤1,000,000)(关于第k大的数:例如序列{1,2,3,4,5,6}中第3大的数是4。)

Input

第一行两个正整数m,n。
第二行为n个正整数。

Output

第k大的数。

Sample Input Copy

6 3
1 2 3 4 5 6

Sample Output Copy

4

Source/Category