hiho week 37 register

Ended

Participants:317

Verdict:Accepted
Score:100 / 100
Submitted:2015-03-15 18:22:06

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
#include<cstdio>
#include<algorithm>
using namespace std;
int n, k;
int num[1000010];
int main() {
    scanf("%d%d", &n, &k);
    for(int i = 0; i < n; i++) scanf("%d", &num[i]);
    nth_element(num, num+k-1, num+n);
    printf("%d\n", num[k-1]);
    return 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX