- 清帝之惑之顺治
- 2009-08-02 17:25:19 @
program huaxue;
var a,f:array[-1..500,-1..500] of longint;
i,m,n,l,maxn:longint;
function max(ii,ll:longint):longint;
begin
if ii>ll then exit(ii) else exit(ll);
end;
procedure work(x,y:longint);
var j,k:longint;
begin
f[x,y]:=1;
for j:=-1 to 1 do
for k:=-1 to 1 do
begin
if ((j+k=-1) or (j+k=1)) and (a[x+j,y+k]f[x,y]) then f[x,y]:=f[x+j,y+k]+1;
end;
end;
end;
begin
fillchar(f,sizeof(f),-1);
read(m,n);
for i:=1 to m do
for l:=1 to n do
begin
read(a);
f:=0;
end;
for i:=1 to m do
for l:=1 to n do
begin
work(i,l);
if f>maxn then maxn:=f;
end;
writeln(maxn);
end.
0 条评论
目前还没有评论...