讨论 / 求找错
杨苏培 2014-01-21 23:05:37
点我顶贴 收藏 删除
program noi2;

var a,b,c:array[1..6] of integer;

q,i,j,k,z,m,e,n,c1:longint;

begin

readln(n);

for i:=1 to n do

begin

readln(c1,m,e);

z:=c1+m+e;

for j:=1 to 5 do

begin

if z>a[j] then

begin

for k:=6 downto j+1 do

begin

a[k]:=a[k-1];

b[k]:=b[k-1];

c[k]:=c[k-1];

end;

a[j]:=z;

b[j]:=i;

c[j]:=c1;

break;

end;

if (z=a[j]) and (c1=c[j]) then

begin

q:=j;

while q<=5 do

begin

if (z=a[q+1]) and (c1=c[q+1]) and (i>b[q+1]) then q:=q+1;

end;

for k:=6 downto q+1 do

begin

a[k]:=a[k-1];

b[k]:=b[k-1];

c[k]:=c[k-1];

end;

a[q]:=z;

b[q]:=i;

c[q]:=c1;

break;

end;

if (z=a[j]) and (c1<>c[j]) then

begin

if c1>c[j] then

begin

for k:=6 downto j+1 do

begin

a[k]:=a[k-1];

b[k]:=b[k-1];

c[k]:=c[k-1];

end;

b[j]:=i;

c[j]:=c1;

break;

end;

if c1<c[j] then

begin

for k:=6 downto j+2 do

begin

a[k]:=a[k-1];

b[k]:=b[k-1];

c[k]:=c[k-1];

end;

a[j+1]:=z;

b[j+1]:=i;

c[j+1]:=c1;

break;

end;

end;

end;

end;

for k:=1 to 5 do

begin

write(b[k]);

write(' ');

write(a[k]);

writeln;

end;

end.

测试点1 Accepted / 3ms / 232kB

测试点2 Accepted / 2ms / 232kB

测试点3 Accepted / 3ms / 232kB

测试点4 Accepted / 2ms / 232kB

测试点5 Unaccepted / 在3行选手输出与标准输出存在差异

标准输出

选手输出

测试点6 Accepted / 1ms / 232kB

测试点7 Unaccepted / 在2行选手输出与标准输出存在差异

标准输出

选手输出

测试点8 Accepted / 2ms / 232kB

测试点9 Accepted / 4ms / 232kB

测试点10 Accepted / 2ms / 232kB

查看更多回复
提交回复