测试结果2: 通过本测试点|有效耗时156:ms
测试结果3: 通过本测试点|有效耗时172:ms
测试结果4: 测试结果错误.错误结果为:485694889 正确结果应为:485694875
测试结果5: 通过本测试点|有效耗时344:ms
测试结果6: 通过本测试点|有效耗时891:ms
测试结果7: 通过本测试点|有效耗时969:ms
测试结果8: 通过本测试点|有效耗时937:ms
测试结果9: 通过本测试点|有效耗时953:ms
测试结果10: 通过本测试点|有效耗时906:ms
-------------------------------------------
想不通为什么就这个点过不了,哪个朋友帮我看看呢,谢谢了。
程序:
var i,j,n,k,k1,k2:longint;s:qword;m:int64;
a:array[1..10001]of int64;
begin
readln(n);
for i:=1 to n do
read(a[i]);
s:=0;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then begin m:=a[i];a[i]:=a[j];a[j]:=m;end;
j:=1;
for i:=1 to n-1 do
begin
s:=s+a[j]+a[j+1];
a[j+1]:=a[j]+a[j+1];
inc(j);
for k:=j+1 to n do
if a[j]<=a[k] then break;
m:=a[j];
for k1:=j to k-1 do
a[k1]:=a[k1+1];
a[k]:=m;
end;
writeln(s);
end.