- 兵分N路
- 2009-08-12 14:02:48 @
水题啊...
一模一样,再加上图论就行了
2 条评论
-
hahayang LV 10 @ 2016-12-11 15:59:26
DP,孩纸。
const
dx:array[1..4] of longint=(-1, -2, -2, -1);
dy:array[1..4] of longint=(2, 1, -1, -2);
var
f:array[-1..1002, -1..1002] of int64;
n, m, i, j, k, x1, x2, y1, y2:longint;
begin
readln(n, m);
readln(x1, x2);
read(y1, y2);
fillchar(f, sizeof(f), 0);
f[x1, x2]:=1;
for i:=x1+1 to y1 do
for j:=1 to m do
for k:=1 to 4 do inc(f[i, j], f[i+dx[k], j+dy[k]]);
if f[y1, y2]=0 then begin
write('NO');
halt
end;
write(f[y1, y2], '00000000')
end. -
2009-08-12 14:09:49@
同学,这种题你加图论?
- 1