水题,画个图推一下低维的就什么都明白了

从低维类推高维

 1 var f:array[0..16,0..101] of int64;
 2     n,m,j,i:longint;
 3 
 4 begin
 5   readln(m,n);
 6   for i:=1 to n do
 7     f[i,1]:=2;
 8   for i:=1 to m do
 9     f[1,i]:=2*i;
10   for i:=2 to n do
11     for j:=2 to m do
12       f[i,j]:=f[i,j-1]+f[i-1,j-1];
13   writeln(f[n,m]);
14 end.
15 
16  
View Code

 

posted on 2015-01-26 19:04  acphile  阅读(130)  评论(0编辑  收藏  举报