w7x7t772007 2013-09-17 06:22:00
点我顶贴
收藏
删除
var
i,j,s,n:longint;
a:array[0..200] of longint;
begin
readln(n);
a[0]:=1;
for i:=1 to n do
begin
for j:=1 to i do
begin
a[i]:=a[i-j]*a[j-1]+a[i];
end;
end;
writeln(a[n]);
end.
PASCAL 这个程序实现了求第N项的通项公式。。
100分 [我要评价一下题目~]
提交日期: 2012-5-19 13:48:00
有效耗时: 1688毫秒
测试结果1: 通过本测试点|有效耗时188ms
测试结果2: 通过本测试点|有效耗时156ms
测试结果3: 通过本测试点|有效耗时172ms
测试结果4: 通过本测试点|有效耗时156ms
测试结果5: 通过本测试点|有效耗时172ms
测试结果6: 通过本测试点|有效耗时156ms
测试结果7: 通过本测试点|有效耗时157ms
测试结果8: 通过本测试点|有效耗时172ms
测试结果9: 通过本测试点|有效耗时156ms
测试结果10: 通过本测试点|有效耗时203ms
提交代码:
#4 GUA@2013-09-17 06:22:00
31201
回复
删除
我一开始就那样想的
依次从i=1到n,已经把f[i-1]和f[n-i-1]算出来了嘛,那么先把i左边移过去有f[i-1]种,在把第i位移过去,在把右边的移过去有f[n-i-1],所以,第i位有f[i-1]*f[n-i-1]这么多种,再累加就对了
#5 lla-leo@2017-02-15 02:57:22
33951
回复
删除
你现在666666666666666666666666666
不要过一会儿就55555555555555555555555
RP值不会一直有