zhou_ksl @ 2024-12-24 18:23:40
#include<bits/stdc++.h>
using namespace std;
int n,m,a[5000000+10];
int main(){
cin>>n>>m;
m=m+1;
for(int i=1;i<=n;i++){
cin>>a[i];
}
sort(a+1,a+n+1);
cout<<a[m];
return 0;
}
?
by _lxc__ @ 2024-12-24 18:29:53
正解二分
by coding_goat @ 2024-12-24 18:29:56
@songzhenghao2023@zhou_ksl
并不是 long long 的问题而是排序就已经超时了,
by songzhenghao2023 @ 2024-12-24 18:31:14
格式化输入输出或快读就过了
by huangzhiyu3925 @ 2024-12-24 18:33:50
sort的时间复杂度是
建议换一个算法
by songzhenghao2023 @ 2024-12-24 18:38:48
https://www.luogu.com.cn/record/124699634
by pika_ @ 2024-12-24 18:41:58
加上ios::sync_with_stdio(false);
就能过了
by hyxgg @ 2024-12-24 18:42:05
@huangzhiyu3925
虽然但是,sort是
by pika_ @ 2024-12-24 18:42:25
这题数据比较水
by songzhenghao2023 @ 2024-12-24 18:43:02
请问什么sort n log^2 n ?
但其实过得了是跑得快
by _xguagua_Firefly_ @ 2024-12-24 18:46:21
@songzhenghao2023