239572 zsx 183 Unaccepted 90分 FreePascal Xeost[5] 查看
239571 zsx 183 Unaccepted 90分 FreePascal Xeost[5] 查看
239568 zsx 183 Unaccepted 90分 FreePascal Xeost[5] 查看
239567 zsx 183 Unaccepted 30分 FreePascal Xeost[5] 查看
239565 zsx 183 Unaccepted 80分 FreePascal Xeost[5] 查看
239564 zsx 183 Unaccepted 80分 FreePascal Xeost[5] 查看
239562 zsx 183 Unaccepted 70分 FreePascal Xeost[5] 查看
查看状态 Show Status
状态题目:阿猫的实验
题目编号:183-阿猫的实验 查看该题
状态: Accepted
测评机: Xeost[5]
得分: 100分
提交日期: 2009-11-10 19:15:00
有效耗时: 1593毫秒
测试结果1: 通过本测试点|有效耗时172ms
测试结果2: 通过本测试点|有效耗时47ms
测试结果3: 通过本测试点|有效耗时62ms
测试结果4: 通过本测试点|有效耗时63ms
测试结果5: 通过本测试点|有效耗时62ms
测试结果6: 通过本测试点|有效耗时62ms
测试结果7: 通过本测试点|有效耗时47ms
测试结果8: 通过本测试点|有效耗时250ms
测试结果9: 通过本测试点|有效耗时203ms
测试结果10: 通过本测试点|有效耗时625ms
提交代码: var f:array[1..3,1..10000] of longint;
a:array[1..3] of longint;
sum1,sum3:array[1..10000] of longint;
n,x1,x2,x3,i,j,s,l:longint;
begin
read(x1,x2,x3,n);
f[1,1]:=1;
for i:=1 to 3 do a[i]:=1;
for i:=1 to n do begin
for j:=1 to a[1] do sum1[j]:=f[1,j];
s:=a[1];l:=0;
fillchar(sum3,sizeof(sum3),0);
for j:=1 to 3 do if l<a[j] then l:=a[j];
for j:=1 to l do begin
inc(sum3[j],f[1,j]*x1+f[2,j]*x2+f[3,j]*x3);
inc(sum3[j+1],sum3[j] div 10);
sum3[j]:=sum3[j] mod 10;end;
for j:=l+1 to l+20 do if sum3[j]<10 then break
else begin
sum3[j+1]:=sum3[j] div 10;
sum3[j]:=sum3[j] mod 10;end;
if sum3[j]=0 then a[1]:=j-1 else a[1]:=j;
for j:=1 to a[1] do f[1,j]:=sum3[j];
if a[3]>a[2] then l:=a[3] else l:=a[2];
for j:=1 to l do begin
f[3,j]:=f[3,j]+f[2,j];
inc(f[3,j+1],f[3,j] div 10);
f[3,j]:=f[3,j] mod 10;end;
if f[3,l+1]<>0 then a[3]:=l+1 else a[3]:=l;
for j:=1 to s do f[2,j]:=sum1[j];
a[2]:=s;
end;
l:=0;
for i:=1 to 3 do if l<a[i] then l:=a[i];
for i:=1 to l do begin
inc(f[1,i],f[2,i]+f[3,i]);
inc(f[1,i+1],f[1,i] div 10);
f[1,i]:=f[1,i] mod 10;end;
if f[1,i+1]<>0 then inc(l);
for i:=l downto 1 do write(f[1,i]);end。