lishuhanji 2013-08-21 03:22:00
点我顶贴
收藏
删除
有效耗时: 3235毫秒
测试结果1: 通过本测试点|有效耗时172ms
测试结果2: 通过本测试点|有效耗时156ms
测试结果3: 通过本测试点|有效耗时157ms
测试结果4: 通过本测试点|有效耗时172ms
测试结果5: 通过本测试点|有效耗时171ms
测试结果6: 通过本测试点|有效耗时188ms
测试结果7: 通过本测试点|有效耗时250ms
测试结果8: 通过本测试点|有效耗时437ms
测试结果9: 通过本测试点|有效耗时641ms
测试结果10: 通过本测试点|有效耗时891ms
提交代码: view sourceprint?01.var
02.
n,i,j:longint;
03.
r:int64;
04.
a:array[1..20000] of longint;
05.begin
06.
readln(n);
07.
for i:=1 to n do readln(a[i]);
08.
r:=0;
09.
for i:=1 to n-1 do
10.
for j:=i+1 to n do
11.
if a[i]>a[j] then r:=r+1;
12.
write(r);
13.end.
输出的变量要用int64