Yungchit @ 2022-06-15 16:53:03
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int a[5000000+10];
int main()
{
int n,k;
cin>>n>>k;
for(int i=0;i<n;i++)
{
cin>>a[i];
}
nth_element(a,a+k,a+n);
cout<<a[k]<<endl;
return 0;
}
by ningago @ 2022-06-15 16:59:38
@Yungchit
读入太慢了
用scanf或者手写read
by Yungchit @ 2022-06-15 17:02:33
把输入改成scanf就可以AC了。关帖。
by Yungchit @ 2022-06-15 17:03:06
@ningago 是的是的,刚刚AC了。