比赛 |
暑假培训B班二测 |
评测结果 |
WAAWAA |
题目名称 |
返回住所 |
最终得分 |
66 |
用户昵称 |
三木公 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.17 MiB |
提交时间 |
2012-07-22 11:29:38 |
显示代码纯文本
var
a,b,c,i,j,ii,jj,k,su,m,n,sum:longint;
xx,yy:array[0..10,0..10]of char;
procedure
ss(x,y,k:longint);
begin
xx[x,y]:='*';
if (xx[x-1,y]='.')and(x-1>0)and(xx[x-1,y]<>'*') then ss(x-1,y,k+1);
if (xx[x,y-1]='.')and(y-1>0)and(xx[x,y-1]<>'*') then ss(x,y-1,k+1);
if (xx[x+1,y]='.')and(x+1<=a)and(xx[x+1,y]<>'*') then ss(x+1,y,k+1);
if (xx[x,y+1]='.')and(y+1<=a)and(xx[x,y+1]<>'*') then ss(x,y+1,k+1);
xx[x,y]:='.';
if (k<=c)and(x=1)and(y=b) then m:=m+1;
end;
begin
assign(input,'backbarn.in');
reset(input);
assign(output,'backbarn.out');
rewrite(output);
readln(a,b,c);
for i:=1 to a do begin
for j:=1 to b do
read(yy[i,j]);
readln;
end;
for ii:=1 to a do
for jj:=1 to b do
xx[ii,jj]:=yy[ii,jj];
if xx[i,j]='.' then begin
k:=0;
ss(a,1,1);
end;
writeln(m);
close(input);
close(output);
end.