mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-10 02:58:48 +00:00
P1923 【深基9.例4】求第k小的数
R38818108
This commit is contained in:
parent
4df57d2fda
commit
5e71c49e9d
16
problem/P1923/P1923.cpp
Normal file
16
problem/P1923/P1923.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
// 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user