zoukankan      html  css  js  c++  java
  • PKU2029

    #include <stdio.h>
    #include 
    <string.h>

    int n, W, H, w, h;
    int m[101][101];
    int cnt;

    void DP()
    {
        
    int i, j;
        
    int c=0;

        
    for(i=w;i<=W;i++)
            
    for(j=h;j<=H;j++)
            
    {
                
    if(j==h)
                
    {
                    c
    =0;
                    
    int ii, jj;
                    
    for(ii=i-w+1;ii<=i;ii++)
                        
    for(jj=1;jj<=h;jj++)
                            
    if(m[ii][jj]==1)
                                c
    ++;
                    
    if(cnt<c)
                        cnt
    =c;
                }

                
    else
                
    {
                    
    int k;
                    
    for(k=i-w+1;k<=i;k++)
                    
    {
                        
    if(m[k][j-h]==1)
                            c
    --;
                        
    if(m[k][j]==1)
                            c
    ++;
                    }

                    
    if(cnt<c)
                        cnt
    =c;
                }

            }


    }


    int main()
    {
        
    while(scanf("%d"&n)==1 && n)
        
    {
            cnt
    =0;
            memset(m,
    0,sizeof(m));
            scanf(
    "%d%d"&W, &H);
            
    int i;
            
    int x, y;
            
    for(i=0;i<n;i++)
            
    {
                scanf(
    "%d%d"&x, &y);
                m[x][y]
    =1;
            }

            scanf(
    "%d%d"&w, &h);
            DP();
            printf(
    "%d\n", cnt);
        }

        
    return 0;
    }
  • 相关阅读:
    airtest支持Cocos-Creator,SDK接入
    Python的getter和setter方法
    liunx常用命令
    liunx的vim常用命令收集
    django+atx+liunx的一些shell脚本
    django+airtest+atx部署liunx平台
    Android下的鉴权实现方案
    Mate20 pro实现H265 (HEVC)实时硬件编码
    OpenCV C++常用功能介绍
    Ubuntu16.04编译libjpeg-turbo库
  • 原文地址:https://www.cnblogs.com/SQL/p/932289.html
Copyright © 2011-2022 走看看