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
最新文章
oracle分组查询(某年12月的数据和每年每月的数据)
Oracle 中文转拼音函数
oracle查询表中字段里数据是否有重复
原生和jQuery的ajax用法
ORACLE的TO_DATE格式
Oracle 关联两表写update语句
206. Reverse Linked List
529. Minesweeper
948. Bag of Tokens
ugly-number-ii
热门文章
575. Distribute Candies
118. Pascal's Triangle
572. Subtree of Another Tree
32. Longest Valid Parentheses
566. Reshape the Matrix
563. Binary Tree Tilt
django之二级联动下拉列表
ATXserver遇到手机无法操作的问题,使用下面命令即可
liunx下基于游戏自动化的django-crontab定时任务实战
基于python2.7+HTMLTestrunner生成报告后样式美化图版以及源码获取
Copyright © 2011-2022 走看看