比赛 |
20140714下午练习 |
评测结果 |
AAAAAAAAAA |
题目名称 |
跳马问题 |
最终得分 |
100 |
用户昵称 |
‘’ |
运行时间 |
0.025 s |
代码语言 |
Pascal |
内存使用 |
0.17 MiB |
提交时间 |
2014-07-14 14:34:31 |
显示代码纯文本
var
i,j,n,m,a,b:longint;
s:array[0..20,0..20] of int64;
procedure v(x,y:integer);
var
i,j:integer;
begin
if x+1<=b then
begin
if y+2<=a then begin s[x+1,y+2]:=s[x+1,y+2]+1; v(x+1,y+2);end;
if y-2>=1 then begin s[x+1,y-2]:=s[x+1,y-2]+1; v(x+1,y-2);end;
end;
if x+2<=b then
begin
if y+1<=a then begin s[x+2,y+1]:=s[x+2,y+1]+1; v(x+2,y+1);end;
if y-1>=1 then begin s[x+2,y-1]:=s[x+2,y-1]+1; v(x+2,y-1);end;
end;
end;
begin
assign(input,'horse.in');
assign(output,'horse.out');
reset(input);
rewrite(output);
read(a,b);
v(1,1);
write(s[b,a]);
close(input);
close(output);
end.