pooooo @ 2021-01-04 20:40:33
这个尝试过用qword,结果就就就60分了,倒数第二个也TLE了,这里放的是longint的!
var
a:array[0..5000000] of longint;
n,i,m:longint;
procedure qsort(l,r:longint);//快排
var i,j,t,mid:longint;
begin
i:=l;
j:=r;
mid:=a[(l+r)div 2];
repeat
while(a[i]<mid) do inc(i);
while(a[j]>mid) do dec(j);
if i<=j then
begin
t:=a[i]; a[i]:=a[j]; a[j]:=t;
inc(i); dec(j);
end;
until i>j;
if l<j then qsort(l,j);
if i<r then qsort(i,r);
end;
begin
readln(n,m);
m:=m+1;
for i:=1 to n do read(a[i]);
qsort(1,n);
writeln(a[m]);
end.
by 123456zmy @ 2021-02-05 15:43:20
@Fwz2020 sort 实测可过
所以需要 @管理员 加强数据吗