这是月赛时候的:
状态: Compile Error
测评机: Xeost[5]
得分: 0分
提交日期: 2011-9-24 20:07:00
有效耗时: 该状态没有记录
编译错误:
编译错误|编译超时[超过6s时限]
提交代码: view sourceprint?01.program p643;
02.const M=1000000009;
03.var a:array[0..500000,1..2]of longint;
04.n,i,t:longint;
05.begin
06.a[0,1]:=1;
07.a[0,2]:=1;
08.for i:=1 to 500000 do begin
09.a[i,2]:=a[i-1,1]+a[i-1,2];
10.a[i,1]:=a[i-1,2];
11.if a[i,2]>=M then a[i,2]:=a[i,2] mod M;
12.end;
13.readln(t);
14.for i:=1 to t do begin
15.readln(n);
16.writeln(a[n,2]);
17.end;
18.end.
这是我刚提交的:
状态: Accepted
测评机: Xeost[5]
得分: 100分 [我要评价一下题目~]
提交日期: 2011-9-25 12:15:00
有效耗时: 5502毫秒
测试结果1: 通过本测试点|有效耗时188ms
测试结果2: 通过本测试点|有效耗时62ms
测试结果3: 通过本测试点|有效耗时657ms
测试结果4: 通过本测试点|有效耗时719ms
测试结果5: 通过本测试点|有效耗时656ms
测试结果6: 通过本测试点|有效耗时672ms
测试结果7: 通过本测试点|有效耗时625ms
测试结果8: 通过本测试点|有效耗时641ms
测试结果9: 通过本测试点|有效耗时641ms
测试结果10: 通过本测试点|有效耗时641ms
提交代码: view sourceprint?01.program p643;
02.const M=1000000009;
03.var a:array[0..500000,1..2]of longint;
04.n,i,t:longint;
05.begin
06.a[0,1]:=1;
07.a[0,2]:=1;
08.for i:=1 to 500000 do begin
09.a[i,2]:=a[i-1,1]+a[i-1,2];
10.a[i,1]:=a[i-1,2];
11.if a[i,2]>=M then a[i,2]:=a[i,2] mod M;
12.end;
13.readln(t);
14.for i:=1 to t do begin
15.readln(n);
16.writeln(a[n,2]);
17.end;
18.end.
明明是一样的,为什么会有这种CE?