poj-2029-Get Many Persimmon Trees-预处理
来源:互联网 发布:c 数组的长度 编辑:程序博客网 时间:2024/05/20 05:58
额,完全一个预处理的问题,为什么要放在DP里。。。
预处理每一个点对起点为那些的方块产生了影响,对应值+1;
#include<stdio.h>#include<string.h>#include<algorithm>#include<iostream>using namespace std;int maps[101][101];struct list{int x;int y;}node[10001];int main(){int n,i,j,k;int w,h,s,t;while(~scanf("%d",&n)&&n){memset(maps,0,sizeof(maps));scanf("%d%d",&w,&h);for(i=0;i<n;i++){scanf("%d%d",&node[i].x,&node[i].y);}cin>>s>>t;int maxn;maxn=0;for(k=0;k<n;k++){int xx,yy;xx=node[k].x;yy=node[k].y;for(i=xx;i>=0&&i>xx-s;i--){for(j=yy;j>=0&&j>yy-t;j--){maps[i][j]++;maxn=max(maps[i][j],maxn);}}}cout<<maxn<<endl;}return 0;}
- poj-2029-Get Many Persimmon Trees-预处理
- POJ 2029 Get Many Persimmon Trees
- Poj 2029 Get Many Persimmon Trees
- POJ 2029 Get Many Persimmon Trees [dp]
- POJ 2029 Get Many Persimmon Trees (标记)
- POJ 2029 Get Many Persimmon Trees
- POJ 2029 Get Many Persimmon Trees
- poj 2029 Get Many Persimmon Trees
- poj 2029 Get Many Persimmon Trees
- POJ 2029 Get Many Persimmon Trees
- POJ 2029 Get Many Persimmon Trees
- POJ 2029--Get Many Persimmon Trees +DP
- poj 2029 Get Many Persimmon Trees
- POJ 2029 Get Many Persimmon Trees
- poj 2029 Get Many Persimmon Trees
- POJ 2029 Get Many Persimmon Trees
- poj 2029 Get Many Persimmon Trees
- poj- 2029 -Get Many Persimmon Trees (DP)
- JavaScript学习笔记(三十三) 经典模式三 借用构造方式并设置原型
- Android-JNI3
- WSO2 ESB 学习(二) ---安装篇
- Ruby实现单例模式
- 教你如何迅速秒杀掉:99%的海量数据处理面试题
- poj-2029-Get Many Persimmon Trees-预处理
- SDL-第一课“hello world”
- [Paper study] Delay learning and polychronization for reservoir computing
- JAVA设计模式之观察者模式2
- intel 64 and IA-32 Archtectures Software Developer's Manual 笔记
- 图像处理--角点检测(Harris以及其他算法研究)
- Android-Linux
- 浏览器窗口被激活
- 黑马程序员-----java基础:面向对象与单例设计模式