- 盖房子
- 2018-07-13 21:45:45 @
type
qw=array[1..200,1..200] of integer;
er=array[1..200] of integer;
var
n,m,i,j,q,w,t:integer;
a:qw;
b:er;
function as(a:qw;w,j,i:integer):integer;
var
l,t:integer;
begin
w:=w+1;t:=0;
for l:=1 to w do
if (a[j+w,i]=1)and(a[j,i+w]=1)and(a[j+w,i+w]=1) then t:=t+1;
if t=w then as:=1+as(a,w,j,i)
else as:=0;
end;
begin
read(n,m);
for i:=1 to n do
for j:=1 to m do
read(a[i,j]);
q:=0;w:=0;
for j:=1 to n do
for i:=1 to m do
if a[j,i]=1 then
begin
q:=q+1;
b[q]:=as(a,w,j,i);
end;
for i:=1 to q do
if t<b[q] then t:=b[q];
writeln(t);
end.
0 条评论
目前还没有评论...