poj2029
来源:互联网 发布:龙之信条saber捏脸数据 编辑:程序博客网 时间:2024/05/16 07:05
#include<iostream>#include<algorithm>using namespace std;
int n;int width,height;int result;int mmax;struct Position{ int x,y;}pos[501];int s,t;
void input(){ cin>>width>>height; for(int i = 1;i <= n;i++) { cin>>pos[i].x >> pos[i].y; } cin>>s>>t;}
bool check(int x,int y){ return ((x <= width) && (y <= height)); }
void panduan(int w,int h){ for(int i = 1;i <= n;i++) { if(((pos[i].x >= w) &&(pos[i].x <= (w+s -1)))&& ((pos[i].y >= h)&& (pos[i].y <= (h+t-1)))) { result++; } }}void solve(){ for(int i = 1;i <= width;i++) { for(int j = 1;j <= height;j++) { if(check(i+s-1,j+t-1)) { panduan(i,j); if(mmax < result) { mmax = result; } result = 0; } } }
}
int main(){ while(cin>>n && n != 0) { input(); // sort(pos+1,pos+n+1,cmp);
result = 0; mmax = 0; solve(); cout<<mmax<<endl;
} return 0; }
- poj2029
- poj2029
- poj2029
- poj2029
- poj2029 2010.4.14
- poj2029 Get Many Persimmon Trees
- POJ2029--Get Many Persimmon Trees
- poj2029 Get Many Persimmon Trees
- poj2029 Get Many Persimmon Trees
- POJ2029 Get Many Persimmon Trees
- poj2029 Get Many Persimmon Trees
- 树状数组学习笔记+poj2029
- POJ2029——Get Many Persimmon Trees
- poj2029--Get Many Persimmon Trees(dp)
- POJ2029 Get Many Persimmon Trees(树状数组~)
- POJ2029:Get Many Persimmon Trees(DP)
- POJ2029--Get Many Persimmon Trees(枚举+二维树状数组)
- POJ2029:Get Many Persimmon Trees(二维树状数组)
- 随笔-关于离职
- Centos5.4下编译安装php5.4.0
- 【小白的java成长系列】——linux下的java环境变量设置
- unicode 的utf-8 和GBK
- WPA破解原理简要——无线网络破解续
- poj2029
- printf 格式
- Linux环境下提升普通用户权限(sudo)
- 如何拿53kf的会员信息
- Android 触摸屏手势识别程序
- Visual Stdio 的的常用快捷键
- 谷歌实习生,只要大二的妹子
- Android Intent 用法全面总结
- 完美编译运行PCRE on Windows , Solved the __imp__pcre_exec __imp__pcre_compile __imp__pcre_free Errors