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