- 月饼盒
- 2009-04-06 15:36:55 @
Program p1255;
Var
n,m,i,j,k,l,ans:longint;
a:array[1..300,1..300] of integer;
tmp:array[1..300,0..300] of longint;
f:array[0..300,0..300] of longint;
Begin
readln(n,m);
for i:=1 to n do
begin
tmp:=0;
for j:=1 to m do
begin
read(a);
if a=0 then a:=-maxint;
tmp:=tmp+a;
end;
readln;
end;
for i:=1 to n do
for j:=1 to m do
for k:=1 to i do
inc(f,tmp[k,j]);
ans:=0;
for i:=1 to n do
for j:=1 to m do
for k:=i to n do
for l:=j to m do
if (f+f[k,l]-f-f[k,j-1])>ans then ans:=f+f[k,l]-f-f[k,j-1];
writeln(ans);
End.
0 条评论
目前还没有评论...