Time Limit: 10000/5000MS (
Java/Others)Memory Limit: 512000/256000KB (Java/Others) SubmitStatisticNext Problem
Problem Description
一天,萌萌的妹子--瑶瑶(tsyao)很无聊,就来找你玩。可是你们都不知道玩什么。。。尴尬了一阵子,机智的瑶瑶就提议:“这样吧,你说N个整数xi,然后在随意说一个数字k,我能够快速地说出这些数字里面第 k 大的数字。”
Input
第1行 两个整数N, K以空格隔开;
第2行 有N个整数(可出现相同数字,均为随机生成),同样以空格隔开。
0 < n ≤ 5*10^6 , 0 < k ≤ n
1 ≤ xi ≤ 10^8
Output
输出第 k 大的数字。
Sample Input
5 2
5 4 1 3 1
Sample Output
4
Hint
如2,2,1中三个数字中第一大数字为2,第二大数字也为2,第三大数字为1 。
Source
tsyao
Manager
tsyao SubmitStatistic
卡我输入简直桑心病狂...
/*
* this code is made by NULL
* Problem: 1099
* Verdict: Accepted
* Submission Date: 2014-09-12 17:35:54
* Time: 3224MS
* Memory: 21212KB
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include