比赛 10101115 评测结果 WWWWWTTTTT
题目名称 牛宫 最终得分 0
用户昵称 donny 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-15 09:02:27
显示代码纯文本
program long(input,output);
var
  i,j,k,l:longint;
  a:array[0..200,0..200]of longint;
  f:array[0..200,0..200,0..200]of longint;
  max,n,m:longint;
  o,p,q:longint;
begin
  assign(input,'long.in');
  reset(input);
  assign(output,'long.out');
  rewrite(output);
  readln(n,m);
  for i:=1 to n do
  begin
    for j:=1 to m do
      read(a[i,j]);
    readln;
  end;
  for i:=1 to n do
    a[i,0]:=0;
  for i:=1 to m do
    a[0,m]:=0;
  a[0,0]:=0;
  for i:=1 to n do
    for j:=1 to m do
      a[i,j]:=a[i,j]+a[i,j-1]+a[i-1,j]-a[i-1,j-1];
  max:=0;
  for i:=1 to n do
    for j:=i to n do
      for k:=1 to m do
        for l:=k to m do
          if (a[j,l]-a[j,k-1]-a[i-1,l]+a[i-1,k-1]>0)and((j-i+1)*(l-k+1)>max) then
            max:=(j-i+1)*(l-k+1);
  writeln(max);
  close(input);
  close(output);
end.