链接

类似最大矩阵 sum存下 枚举最大就是

 #include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
using namespace std;
int sum[][],o[][];
int main()
{
int i,j,n,w,h,a,b;
while(scanf("%d",&n)&&n)
{
scanf("%d%d",&h,&w);
memset(o,,sizeof(o));
memset(sum,,sizeof(sum));
for(i = ; i <= n ;i++)
{
scanf("%d%d",&a,&b);
o[b][a] = ;
}
int s,t;
scanf("%d%d",&s,&t);
for(i = ; i <= w ; i++)
for(j = ; j <= h ; j++)
sum[i][j] = sum[i-][j]+sum[i][j-]-sum[i-][j-]+o[i][j];
int ans = ;
for(i = t; i <= w ; i++)
for(j = s ; j <= h ; j++)
ans = max(ans,sum[i][j]-sum[i-t][j]-sum[i][j-s]+sum[i-t][j-s]);
printf("%d\n",ans);
}
return ;
}

poj2029Get Many Persimmon Trees(最大矩阵和)的更多相关文章

  1. poj2029 Get Many Persimmon Trees

    http://poj.org/problem?id=2029 单点修改 矩阵查询 二维线段树 #include<cstdio> #include<cstring> #inclu ...

  2. POJ 2029 Get Many Persimmon Trees

    Get Many Persimmon Trees Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3243 Accepted: 2 ...

  3. POJ2029——Get Many Persimmon Trees

    Get Many Persimmon Trees Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3656   Accepte ...

  4. (简单) POJ 2029 Get Many Persimmon Trees,暴力。

    Description Seiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aiz ...

  5. POJ-2029 Get Many Persimmon Trees(动态规划)

    Get Many Persimmon Trees Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3987 Accepted: 2 ...

  6. POJ 2029 Get Many Persimmon Trees (二维树状数组)

    Get Many Persimmon Trees Time Limit:1000MS    Memory Limit:30000KB    64bit IO Format:%I64d & %I ...

  7. xtu数据结构 B. Get Many Persimmon Trees

    B. Get Many Persimmon Trees Time Limit: 1000ms Memory Limit: 30000KB 64-bit integer IO format: %lld  ...

  8. POJ2029:Get Many Persimmon Trees(二维树状数组)

    Description Seiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aiz ...

  9. POJ 2029 Get Many Persimmon Trees (模板题)【二维树状数组】

    <题目链接> 题目大意: 给你一个H*W的矩阵,再告诉你有n个坐标有点,问你一个w*h的小矩阵最多能够包括多少个点. 解题分析:二维树状数组模板题. #include <cstdio ...

随机推荐

  1. IOS-7步学会用代理

    代理:又叫委托 自己不能去办的事委托给别人去办 之前学过的 UIAlertView UITextField都是使用了代理 反向传值代理 代理Block 写代理的步骤 需要帮忙的人(请求帮代饭的人) 1 ...

  2. MSBuild could not create or connect to a task host with runtime "CLR2" and architecture "x86".

    vs2010 and vs2012 are installed on target machine. Build c# project using vs2010, following error oc ...

  3. 第8条:覆盖equals时遵守通用约定

    如果不需要覆盖equals方法,那么就无需担心覆盖equals方法导致的错误. 什么时候不需要覆盖equals方法? 1.类的每个实例本质上是唯一的. 例如对于Thread,Object提供的equa ...

  4. ThreadPoolExecutor 线程池的实现

    ThreadPoolExecutor继承自 AbstractExecutorService.AbstractExecutorService实现了 ExecutorService 接口. 顾名思义,线程 ...

  5. rpm的一些用法

    rpm2cpio *.rpm | cpio -imd     #解压一个rpm包 rpm -ivh *.rpm  --force         #强制安装这个rpm包 rpm -ivh *.rpm  ...

  6. mysql 之权限介绍

    转自:http://tech.it168.com/a2010/0114/837/000000837456_all.shtml 一.MySQL授权表概述首先从全局开始,如果全局的是允许的,即在 user ...

  7. 根据版本的不同整理所有的绿色SQL Server

    在这篇论坛文章中,读者可以了解到如何根据不同的SQL Server版本,整理出所有版本的绿色SQL Server的具体方法,详细内容请参考下文: 1. Sqlservr.exe 运行参数 Sql Se ...

  8. WPF中Application.Current的使用

    WPF程序对应一个Application对象,当前的Application对象可以通过Application.Current获取,通过获取到的Application对象,我们可以做以下的事情: App ...

  9. 数位DP入门之hdu 3555 Bomb

    hdu 3555 Bomb 题意: 在1~N(1<=N<=2^63-1)范围内找出含有 ‘49’的数的个数: 与hdu 2089 不要62的区别:2089是找不不含 '4'和 '62'的区 ...

  10. C和BlockCode

    在使用code block的时候,需要先build,然后再run,否则run的还是上次编译的内容.