zoj1716 Get Many Persimmon Trees

来源:互联网 发布:推荐一款模拟钢琴软件 编辑:程序博客网 时间:2024/05/16 05:05





//2613762 2011-08-03 16:55:55 Accepted 1716 C++ 10 188 ylwh!#include <stdio.h>#include <string.h>#define MAX 101using namespace std;int w, h, n, s, t;bool map[MAX][MAX];void input(){int i, x, y;scanf("%d%d", &w, &h);for(i=0; i<n; i++){scanf("%d%d", &x, &y);map[x][y] = true;}scanf("%d%d", &s, &t);}int search(int x, int y){int i, j, count=0;for(i=x; i<x+s; i++)for(j=y; j<y+t; j++)if(map[i][j] == true)count++;return count;}int main(){int i, j, maxn, temp;while(scanf("%d", &n) , n){memset(map, false, sizeof(map));input();maxn = 0;for(i=1; i<=w-s+1; i++)for(j=1; j<=h-t+1; j++){temp = search(i, j);if(temp > maxn)maxn = temp;}printf("%d\n", maxn);}return 0;}


原创粉丝点击