去掉就ac了。why?
var num:array[-1..100,-1..100]of qword;
i,j,m,n,x,y:integer;
function cheak(xm,yn:integer):boolean;
begin
cheak:=true;
if (xm=x)and(yn=y) then cheak:=false;
if (abs(xm-x)=2)and(abs(yn-y)=1)then cheak:=false;
if (abs(xm-x)=1)and(abs(yn-y)=2)then cheak:=false;
end;
begin
readln(m,n,x,y);
num[0,0]:=1;
{fillchar(num,sizeof(num),0);}
for i:=0 to M do
for j:=0 to N do
if cheak(i,j) and((i<>0)or(j<>0)) then
num[i,j]:=num[i-1,j]+num[i,j-1];
writeln(num[M,N]);
readln;
end.
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 qword;
begin
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])
end.