Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这……暴力的N^2当然不超时,n才100……好弱的数据var a,sum:array[0..100,0..100]of longint; n,w,h,s,t,i,j,x,y,ans:longint; begin repeat readln(n); if n=0 then break; readln(w,h); fillchar(a,sizeof(a),0); fillchar(sum,sizeof(sum),0); for i:=1 to n do begin readln(x,y); a[y,x]:=1; end; readln(s,t); for i:=1 to h do for j:=1 to w do sum[i,j]:=sum[i-1,j]+sum[i,j-1]-sum[i-1,j-1]+a[i,j]; ans:=0; for i:=t to h do for j:=s to w do if ans<sum[i,j]-sum[i,j-s]-sum[i-t,j]+sum[i-t,j-s] then ans:=sum[i,j]-sum[i,j-s]-sum[i-t,j]+sum[i-t,j-s]; writeln(ans); until false; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator