讨论 / 读入->快排->输出
L.Lawliet 2013-08-09 02:35:00
点我顶贴 收藏 删除
题目:[color=red]统计数字[/color]

状态: [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.

#1 L.Lawliet@2010-05-30 00:50:00
回复 删除
[color=blue]自己占一个[/color]
#2 L.Lawliet@2010-05-30 00:54:00
回复 删除
[color=red]大家看看我的用户介绍啊[/color]

帅不帅?

我的偶像~~

#3 L.Lawliet@2010-05-30 00:54:00
回复 删除
大家看看我的用户介绍啊

帅不帅?

我的偶像~~

#4 931903999@2010-05-30 03:43:00
回复 删除
猥琐

其他还好,就是太猥琐.

#5 L.Lawliet@2010-05-30 05:23:00
回复 删除
回复 地板931903999 的帖子

怎么猥琐了?= =!

#6 mcm_noip@2010-09-21 04:00:00
回复 删除
回复 地下室L.Lawliet 的帖子

= =...怪不得觉得语气很熟悉。。。。

#7 twywssl@2013-08-09 02:35:00
回复 删除

额,我想这里不是用来讨论这个的吧

查看更多回复
提交回复