- 马拦过河卒
- 2016-07-21 16:07:06 @
测试数据 #0: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 816 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 812 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 812 KiB, score = 10
Accepted, time = 0 ms, mem = 816 KiB, score = 100
//ghz.pas
var
i,j,a,b,c,d:longint;
f,fa:array[-2..22,-2..22]of int64;
begin
// assign(input,'ghz.in');
// assign(output,'ghz.out');
// reset(input);
// rewrite(output);
read(c,d);
read(a,b);
fillchar(f,sizeof(f),0);
fillchar(fa,sizeof(fa),0);
fa[a,b]:=-1;
fa[a-2,b-1]:=-1;
fa[a-2,b+1]:=-1;
fa[a-1,b-2]:=-1;
fa[a-1,b+2]:=-1;
fa[a+1,b-2]:=-1;
fa[a+1,b+2]:=-1;
fa[a+2,b-1]:=-1;
fa[a+2,b+1]:=-1;
f[0,-1]:=1;
for i:=0 to c do
for j:=0 to d do
if fa[i,j]<>-1 then
f[i,j]:=f[i-1,j]+f[i,j-1];
writeln(f[c,d]);
// close(input);
// close(output);
end.
1 条评论
-
Cookiezi LV 7 @ 2016-07-22 09:33:30
题解请发布到题解区
- 1