提交日期: 2008-4-7 23:11:00
有效耗时: 161毫秒
测试结果1: 无输出|运行超时
测试结果2: 无输出|运行超时
测试结果3: 无输出|运行超时
测试结果4: 无输出|运行超时
测试结果5: 无输出|运行超时
测试结果6: 无输出|运行超时
测试结果7: 无输出|运行超时
测试结果8: 无输出|运行超时
测试结果9: 无输出|运行超时
测试结果10: 无输出|运行超时
program p133;
var
n,i:longint;
j:integer;
a:array[0..200000]of longint;
outnum,out:array[1..10000]of longint;
procedure quick(s,t:longint);
var
i,j,mid,temp:longint;
begin
i:=s;j:=t;mid:=(a[i]+a[j])div 2;
repeat
while a[i]<mid do inc(i);
while a[j]>mid do dec(i);
if i<=j then
begin
temp:=a[i];
a[i]:=a[j];
a[j]:=temp;
inc(i);
dec(j);
end;
until i>j;
if i<t then quick(i,t);
if j>s then quick(s,j);
end;
begin
readln(n);
for i:=1 to n do
readln(a[i]);
a[0]:=-1;
quick(1,n);
for i:=1 to n do
if a[i]<>a[i-1] then
begin
inc(j);
outnum[j]:=a[i];
inc(out[j]);
end else
inc(out[j]);
for i:=1 to j-1 do
writeln(outnum[i], ,out[i]);
write(outnum[j], ,out[j]);
end.
测评机有问题吗?