uses math;
var m,n,max:longint;
a,f:array[0..1000,0..1000] of longint;
procedure nhap;
var i,j:longint;
begin
readln(m,n);
for i:=1 to m do
begin
for j:=1 to n do read(a[i,j]);
readln;
end;
end;
procedure solve;
var i,j,x,y:longint;
begin
max:=0;
for i:=1 to m do
for j:=1 to n do
begin
x:=i-1;y:=j-1;
if (a[i,j]=a[x,j]) and (a[i,j]=a[i,y]) and (a[i,j]=a[x,y]) then
f[i,j]:=min(f[i,y],min(f[x,j],f[x,y]))+1
else f[i,j]:=1;
if f[i,j]>max then max:=f[i,j];
end;
write(max);
end;
begin
assign(input, 'qbsquare.inp');reset(input);
assign(output, 'qbsquare.out');rewrite(output);
nhap;
solve;
end.
* Chuyên dạy lập trình ONLINE cho học sinh THCS, THPT *.
Mọi giao lưu, trao đổi, xin liên hệ: Lê Quang Vinh - zalo: 037.803.8755.
Page: Lớp học Code Sky
Group FB1: Ôn thi HSG9 - THTB - TS10 chuyên tin
Group FB2: Học Scratch - Ôn thi Tin học trẻ bảng A
Thứ Sáu, 13 tháng 5, 2022
QBSQUARE PASCAL
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét
Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.