- 马拦过河卒
- 2009-10-29 13:04:30 @
program project1121;
var a:array[0..15,0..15]of longint;
i,j,n,m,x,y:integer;
begin
read(n,m,x,y);
for i:=0 to n do
for j:=0 to m do
a:=1;
a[x+2,y-1]:=0;a[x,y]:=0;a[x+2,y+1]:=0;a[x+1,y-2]:=0;a[x+1,y+2]:=0;a[x-1,y+2]:=0;a[x-1,y-2]:=0;a[x-2,y-1]:=0;a[x-2,y+1]:=0;
for i:=2
to n+m do
for j:=0 to i+1 do
if (i-j0) and (a[j,i-j]0) and (j
6 条评论
-
我是傻蛋 LV 7 @ 2015-08-20 15:51:47
ninalidoucuole
-
2009-11-02 13:00:45@
已经改正了,谢谢大家program project1121;
var a:array[0..15,0..15]of longint;
i,j,n,m,x,y:integer;
begin
read(n,m,x,y);
for i:=0 to n do
for j:=0 to m do
a:=1;
if (x-1=0)then
for i:=y-2 to m do a[0,i]:=0;
if (x-2=0) then
for i:=y-1 to m do a[0,i]:=0;
if (y-1=0) then
for i:=x-2 to n do a:=0;
if (y-2=0) then
for i:=x-1 to n do a:=0;
a[x+2,y-1]:=0;a[x,y]:=0;a[x+2,y+1]:=0;a[x+1,y-2]:=0;a[x+1,y+2]:=0;a[x-1,y+2]:=0;a[x-1,y-2]:=0;a[x-2,y-1]:=0;a[x-2,y+1]:=0;
for i:=2
to n+m do
for j:=0 to i+1 do
if (i-j0) and (a[j,i-j]0) and (j -
2009-10-29 14:33:20@
因为M,N=15超时,用高精度
-
2009-10-29 14:09:19@
有一个答案比正确植长,为什吗
-
2009-10-29 13:45:07@
应为第1步中a[x,y]仅有2个,不是x=0就是Y=0
-
2009-10-29 13:09:43@
for i:=2 to n+m do
为什么从2开始呢..?
- 1