没睡醒的猪 2008-01-29 20:40:00
点我顶贴
收藏
删除
var a:array[-1..16,-1..16] of boolean
b:array[-1..16,-1..16] of longint
c,d,n,zong,x,y,x1,y1:longint
begin
fillchar(a,sizeof(a),true)
fillchar(b,sizeof(b),0)
b[0,0]:=1
readln(x,y,x1,y1)
a[x1,y1]:=false
if ((x1>=2) and (y1>=1)) then a[x1-2,y1-1]:=false
if ((x1>=1) and (y1>=2)) then a[x1-1,y1-2]:=false
if ((x1<=x-1) and (y1>=2)) then a[x1+1,y1-2]:=false
if ((x1<=x-2) and (y1>=1)) then a[x1+2,y1-1]:=false
if ((x1>=2) and (y1<=y-1)) then a[x1-2,y1+1]:=false
if ((x1>=1) and (y1<=y-2)) then a[x1-1,y1+2]:=false
if ((x1<=x-1) and (y1<=y-2)) then a[x1+1,y1+2]:=false
if ((x1<=x-2) and (y1<=y-1)) then a[x1+2,y1+1]:=false
for c:=0 to x do
for d:=0 to y do
if ((c<>0) or (d<>0)) then if a[c,d] then b[c,d]:=b[c,d-1]+b[c-1,d]
writeln(b[x,y])
end.
在vijos上一次就Ac了啊~