C_R_X_12_02_07 @ 2024-03-21 18:28:21
帮我这个蒟蒻看看,两个(第四和第五个)测试点超时了,是不是数组开大了
#include <bits/stdc++.h>
using namespace std;
int a[5000000],n,k;
int main(){
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>a[i];
}
nth_element(a,a+k,a+n);
cout<<a[k];
return 0;
}
by int_stl @ 2024-03-21 18:44:21
@C_R_X_12_02_07 加 ios::sync_with_stdio(0);
by C_R_X_12_02_07 @ 2024-03-21 19:20:31
@int_stl 对了,感谢
by w_moon @ 2024-04-22 20:28:06
@C_R_X_12_02_07 改scanf printf应该也能对