状态: [color=green]Accepted[/color]
测评机: Xeond[6]
得分: 100分
提交日期: 2010-5-30 10:24:00
有效耗时: 3173毫秒
测试结果1: [color=green]通过本测试点|有效耗时172ms[/color]
测试结果2: [color=green]通过本测试点|有效耗时156ms[/color]
测试结果3: [color=green]通过本测试点|有效耗时172ms[/color]
测试结果4: [color=green]通过本测试点|有效耗时203ms[/color]
测试结果5: [color=green]通过本测试点|有效耗时297ms[/color]
测试结果6: [color=green]通过本测试点|有效耗时407ms[/color]
测试结果7: [color=green]通过本测试点|有效耗时344ms[/color]
测试结果8: [color=green]通过本测试点|有效耗时657ms[/color]
测试结果9: [color=green]通过本测试点|有效耗时703ms[/color]
测试结果10: [color=green]通过本测试点|有效耗时62ms[/color]
program tongjishuzi;
const maxn=200000;
var a:array[0..maxn]of dword;
i,n,k,m:longint;
s:dword;
procedure qsort(x,y:longint);
var i,j,k:longint;
begin
i:=x;
j:=y;
k:=(x+y)div 2;
a[0]:=a[k];
a[k]:=a[x];
while i<j do
begin
while (a[j]>=a[0])and(i<j) do dec(j);
a[i]:=a[j];
while (a[i]<=a[0])and(i<j) do inc(i);
a[j]:=a[i];
if i=j then break;
end;
a[i]:=a[0];
if i>x+1 then qsort(x,i-1);
if i+1<y then qsort(i+1,y);
end;
{main}
begin
readln(n);
for i:=1 to n do readln(a[i]);
qsort(1,n);
m:=1;
while true do
begin
s:=a[m];
k:=0;
while a[m]=s do
begin
inc(m);
inc(k);
end;
writeln(s,' ',k);
if m>n then halt;
end;
end.