0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 02:18:51 +00:00
OI-codes/Luogu/problem/P1923/P1923.cpp

17 lines
290 B
C++
Raw Normal View History

// R38818108
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, a[5000005];
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
nth_element(a, a + m, a + n); // sort(a, a+n);
printf("%d\n", a[m]);
return 0;
}