- 送给圣诞夜的极光
- 2009-02-20 23:37:14 @
program K_NigHt_L;
const
dx:array[1..12]of -2..2=(-2,2,0,0,-1,-1,-1,0,0,1,1,1);
dy:array[1..12]of -2..2=(0,0,-2,2,-1,0,1,-1,1,-1,0,1);
var
l:array[-1..102,-1..102]of char;
b:array[-1..102,-1..102]of boolean;
d:array[1..10000,1..2]of integer;
n,m,i,j,total:integer;
procedure init;
var
i,j:integer;
begin
readln(n,m);
for i:=1 to n do
begin
for j:=1 to m do
begin
read(l);
readln;
end;
end;
fillchar(b,sizeof(b),true);
total:=0;
end;
procedure sos(p,q:integer);
var
i,j,x,y,t,w,k:integer;
begin
inc(total); t:=1; w:=1; d[1,1]:=p; d[1,2]:=q;
b[p,q]:=false;
repeat
for k:=1 to 12 do
begin
x:=d[t,1]+dx[k];
y:=d[t,2]+dy[k];
if (x>=1)and(x=1)and(yw;
end;
begin
init;
for i:=1 to n do
for j:=1 to m do
if (l='-') then b:=false;
for i:=1 to n do
for j:=1 to m do
if b then sos(i,j);
writeln(total);
end.
2 条评论
-
fcoaxtwn LV 4 @ 2015-08-10 23:31:05
挖 (斜眼笑)【贴吧水惯了】
-
2009-05-12 21:12:27@
不清楚
不清楚,期待大牛,顶起老帖
- 1