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;
    }
  • 相关阅读:
    数据库的连接、会话与SQLite
    数据库的连接
    SQlite的结构——存储管理
    数据库 schema含义
    SQLite这么娇小可爱,不多了解点都不行啊
    简析打开数据库流程
    计算机系为什么要学数据库原理和设计?
    SQLite的sqlite3_prepare_v2
    Sqlite3并发读写注意事项
    SQLite也可能出现死锁
  • 原文地址:https://www.cnblogs.com/SQL/p/932289.html
Copyright © 2011-2022 走看看