记录编号 1500 评测结果 AAAWWA
题目名称 [NOIP 2002]过河卒 最终得分 66
用户昵称 GravatarE.M.B.E.R 是否通过 未通过
代码语言 Pascal 运行时间 0.046 s
提交时间 2008-09-03 14:00:39 内存使用 0.20 MiB
显示代码纯文本
program EmberAsh;
var
n,m,n1,m1,i,j:longint;
a:array[-50..100,-50..100]of longint;
BEGIN
assign(input,'pj024.in');reset(input);
assign(output,'pj024.out');rewrite(output);
readln(m,n,m1,n1);
a[0,0]:=1;
a[m1,n1]:=-1;
if a[m1+1,n1+2]=0 then a[m1+1,n1+2]:=-1;
if a[m1+1,n1-2]=0 then a[m1+1,n1-2]:=-1;
if a[m1-1,n1+2]=0 then a[m1-1,n1+2]:=-1;
if a[m1-1,n1-2]=0 then a[m1-1,n1-2]:=-1;
if a[m1+2,n1-1]=0 then a[m1+2,n1-1]:=-1;
if a[m1+2,n1+1]=0 then a[m1+2,n1+1]:=-1;
if a[m1-2,n1-1]=0 then a[m1-2,n1-1]:=-1;
if a[m1-2,n1+1]=0 then a[m1-2,n1+1]:=-1;
for i:=0 to m do
for j:=0 to n do
if a[i,j]<>-1 then
begin
if a[i-1,j]<>-1 then a[i,j]:=a[i,j]+a[i-1,j];
if a[i,j-1]<>-1 then a[i,j]:=a[i,j]+a[i,j-1];
end;
writeln(a[m,n]);
close(input);close(output);
end.