记录编号 21929 评测结果 AAAAATTTTT
题目名称 牛宫 最终得分 50
用户昵称 Gravatarmagic 是否通过 未通过
代码语言 Pascal 运行时间 6.609 s
提交时间 2010-11-15 21:23:59 内存使用 0.73 MiB
显示代码纯文本
program gls;
var
m,n,i,j,k,l,p:longint;
sum,max:int64;

data:array[0..200,0..200]of int64;
bas:array[0..200,0..200]of int64;
f,g:text;
   function mul(x,y:longint):int64;
   var i,j:longint;max:int64;
   begin max:=0;
        for i:=1 to y do max:=max+data[x,i];
        for j:=1 to x do max:=max+data[j,y];
        max:=max-data[x,y];
        mul:=max;



   end;
begin
  assign(f,'long.in');
  reset(f);
  assign(g,'long.out');
  rewrite(g);
  readln(f,m,n);
  for i:=1 to m do
  begin for j:=1 to n do
        read(f,data[i,j]);
  end;
  for i:=1 to m do
begin  for j:=1 to n do
   bas[i,j]:=bas[i-1,j-1]+mul(i,j);
end;
  for i:=0 to m do begin bas[0,i]:=0; bas[i,0]:=0;end;

       for i:=1 to m do
        for j:=1 to n do
         for k:=m downto i do
          for l:=n downto j do
      begin begin sum:=bas[k,l]-bas[k,j-1]-bas[i-1,l]+bas[i-1,j-1];
                  p:=(k-i+1)*(l-j+1);
            end;
      if  (sum>0)and(p>max) then begin max:=p; break;end;



      end;





writeln(g,max);

  close(f);close(g);
end.