Maxuejun @ 2024-03-03 17:03:45
快读+快写+sort能过(亲测)
#include<bits/stdc++.h>
using namespace std;
int read(){
int x=0,f=1;
char c=getchar();
while(c<'0'||c>'9'){
if(c=='-'){
f=-1;
}
c=getchar();
}
while(c>='0'&&c<='9'){
x=x*10+c-'0';
c=getchar();
}
return x*f;
}
void write(int x){
if(x<0){
x=-x;
putchar('-');
}
if(x>9){
write(x/10);
}
putchar(x%10+'0');
}
int x[5000005],k,n;
int main(){
n=read();k=read();
for(int i=0;i<n;i++){
x[i]=read();
}
sort(x,x+n);
write(x[k]);
return 0;
}
8ms/836.00KB AC
Accepted, 得分 20.ok accepted
7ms/828.00KB
AC
Accepted, 得分 20.ok accepted
9ms/724.00KB
AC
Accepted, 得分 20.ok accepted
421ms/18.42MB
AC
Accepted, 得分 20.ok accepted
495ms/19.46MB
AC
Accepted, 得分 20.ok accepted
by QWQ_123 @ 2024-03-05 17:57:55
@Maxuejun 你在表达什么,看看这是什么时候的题,然后看看当时的评测机速度罢(