记录编号 |
7233 |
评测结果 |
AAAWWA |
题目名称 |
[NOIP 2002]过河卒 |
最终得分 |
66 |
用户昵称 |
MayLava |
是否通过 |
未通过 |
代码语言 |
Pascal |
运行时间 |
0.000 s |
提交时间 |
2008-11-07 14:09:59 |
内存使用 |
0.12 MiB |
显示代码纯文本
program MayLava(input,output);
const
dx:array[1 .. 8]of Shortint=(-2,-1,1,2,2,1,-1,-2);
dy:array[1 .. 8]of Shortint=(1,2,2,1,-1,-2,-2,-1);
var
n,m,x,y,i,j:Byte;
g:array[0..20,0..20] of Byte;
f:array[0..20,0..20] of Comp;
begin
assign(input,'pj024.in');
reset(input);
assign(output,'pj024.out');
rewrite(output);
readln(n,m,x,y);
fillchar(g,Sizeof(g),0);
g[x, y]:=1;
for i:=1 to 8 do
if (x+dx[i]>=0) and (x+dx[i]<=n) and (y+dy[i]>=0) and (y+dy[i]<=m) then
g[x+dx[i],y+dy[i]]:=1;
f[0,0]:=1;
for i:=1 to n do
if g[i,0]=0 then f[i, 0]:=f[i-1,0];
for i:= 1 to m do
if g[0,i]=0 then f[0,i]:=f[0,i-1];
for i:=1 to n do
for j:=1 to m do
if g[i,j]=0 then f[i,j]:=f[i-1,j]+f[i,j-1];
writeln(f[n,m]:0:0);
close(input);
close(output);
end.