记录编号 48170 评测结果 AAAAAAAAAAAAAAAAAAAA
题目名称 [東方S2] 射命丸文 最终得分 100
用户昵称 GravatarAbel·S 是否通过 通过
代码语言 Pascal 运行时间 2.810 s
提交时间 2012-11-04 22:08:48 内存使用 5.01 MiB
显示代码纯文本
program cojs_p997;
var
	tra:array[0..1000,0..1000] of integer;
        sum:array[0..1000,0..1000] of longint;
	i,j,k,n,m,r,c,max,now:longint;
procedure ass;
begin
	assign(input,'aya.in');
	assign(output,'aya.out');
	reset(input);
	rewrite(output);
end;
procedure cls;
begin
	close(input);
	close(output);
end;
begin
	ass;
	readln(n,m,r,c);
	for i:=1 to n do
		for j:=1 to m do
		begin
			read(tra[i,j]);
			sum[i,j]:=sum[i,j-1]+tra[i,j];
		end;
	for i:=1 to n-r+1 do
		for j:=1 to m-c+1 do
		begin
			now:=0;
			for k:=i to i+r-1 do
				inc(now,sum[k,j+c-1]-sum[k,j-1]);
			if now>max
				then max:=now;
		end;
	writeln(max);
	cls;
end.