Jzz3778__MC @ 2024-07-07 20:45:12
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main()
{
cin>>a>>b;;
int k[a];
for(int i=0;i<a;i++){
cin>>k[i];
}
sort(k,n+a);
cout<<k[b];
return 0;
}
直接 坐下了...
by Luliuyan114514 @ 2024-07-07 20:48:59
@Jzz3778__MC 用STL map
试一下
by Infinity_Fantasy @ 2024-07-07 20:54:33
sort有问题 @Jzz3778__MC
by Infinity_Fantasy @ 2024-07-07 20:55:16
@Jzz3778__MC 还有就是尽量不要用
int k[a];
这样定义数组
by Jzz3778__MC @ 2024-07-07 20:56:51
@Infinity_Fantasy 谢谢Thanks♪(・ω・)ノ
by Infinity_Fantasy @ 2024-07-07 20:57:22
@Jzz3778__MC 还有就是这题sort是过不去的要用分治
by Jzz3778__MC @ 2024-07-07 20:58:54
@Infinity_Fantasy 改了还是不行╥﹏╥
by Infinity_Fantasy @ 2024-07-07 21:01:21
@Jzz3778__MC 因为sort是错误的做法,分治的做法去看题解