0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-20 16:25:25 +00:00
OI-codes/Luogu/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;
}