比赛 10101115 评测结果 AAAAATTTTT
题目名称 牛宫 最终得分 50
用户昵称 reamb 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2010-11-15 10:01:58
显示代码纯文本
program niugong;
var
  a,sum:array[0..200,0..200]of real;
  n,m,i,j,i1,i2,j1,j2,max:longint;
  d:real;
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
      for j:=1 to m do
        sum[i,j]:=sum[i-1,j]+sum[i,j-1]-sum[i-1,j-1]+a[i,j];
    for i1:=1 to n do
      for j1:=1 to m do
        for i2:=i1 to n do
          for j2:=j1 to m do
          begin
            d:=sum[i2,j2]-sum[i2,j1-1]-sum[i1-1,j2]+sum[i1-1,j1-1];
            if d>0 then
              if (i2-i1+1)*(j2-j1+1)>max then
                max:=(i2-i1+1)*(j2-j1+1)
          end;
    writeln (max);
  close (input);
  close (output)
end.