why

测试数据 #0: Accepted, time = 0 ms, mem = 880 KiB, score = 5
测试数据 #1: WrongAnswer, time = 0 ms, mem = 880 KiB, score = 0
测试数据 #2: WrongAnswer, time = 0 ms, mem = 880 KiB, score = 0
测试数据 #3: WrongAnswer, time = 0 ms, mem = 884 KiB, score = 0
测试数据 #4: WrongAnswer, time = 0 ms, mem = 880 KiB, score = 0
WrongAnswer, time = 0 ms, mem = 884 KiB, score = 5
program losd;
var a,b:array[0..1002]of ansistring;
i,j,n,m,k,l:longint;
q:ansistring;
begin
readln(n);
for i:=1 to n do
begin
readln(b[i]);
readln(a[i]);
end;
for i:=1 to n-1 do
for j:=i to n do
if length(a[i])<length(a[j]) then
begin
q:=a[i];a[i]:=a[j];a[j]:=q;
q:=b[i];b[i]:=b[j];b[j]:=q;
end;

for i:=1 to n-1 do
if length(a[i])=length(a[i+1]) then
if (a[i]<a[i+1])or((a[i]=a[i+1])and(b[i]>b[i+1]))
then
begin
q:=a[i];a[i]:=a[i+1];a[i+1]:=q;
q:=b[i];b[i]:=b[i+1];b[i+1]:=q;
end;

for i:=1 to n do
writeln(b[i]);
end.

0 条评论

目前还没有评论...

信息

ID
1257
难度
6
分类
其他 | 排序 点击显示
标签
(无)
递交数
4117
已通过
1161
通过率
28%
被复制
3
上传者