zps1122 @ 2022-05-15 10:44:02
#include<bits/stdc++.h>
using namespace std;
int a[5000005];
int n,k;
int main(){
cin>>n>>k;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+1+n);
cout<<a[k+1];
return 0;
}
by MujicaSaki @ 2022-05-15 10:45:33
@zps1122 得手写
by Fast_IO @ 2022-05-15 10:45:41
要用二分
by Fast_IO @ 2022-05-15 10:46:24
因为本题的重点在于练习分治算法