K_func @ 2024-01-29 10:29:41
#include <bits/stdc++.h>
using namespace std;
int n,k,arr[5000001];
int read(){
int a = 0;
while(1){
int c = getchar();
if(c>'9'||c<'0'){
a/=10;
break;
}
c-=48;
a+=c;
a*=10;
}
return a;
}
int main(){
n = read();
k = read();
for(int i=1;i<=n;i++){
arr[i] = read();
}
sort(arr,arr+n);
cout<<arr[k+1];
return 0;
}
WA后三个(没有超时)
by K_func @ 2024-01-29 10:30:13
在线急等
by __PRO__ @ 2024-01-29 10:34:11
@Jadejunxi 你快读写炸了。
by K_func @ 2024-01-29 10:39:00
@PRO OK,已关
by Abelxxyy @ 2024-02-14 08:45:32
@Jadejunxi ,如果下表为
sort(a + 1,a + n + 1);