![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心
文章平均质量分 57
ting9933
这个作者很懒,什么都没留下…
展开
-
思维-最长连续子序列
五一到了,PKU-ACM队组织大家去登山观光,队员们发现山上一个有N个景点,并且决定按照顺序来浏览这些景点,即每次所浏览景点的编号都要大于前一个浏览景点的编号。同时队员们还有另一个登山习惯,就是不连续浏览海拔相同的两个景点,并且一旦开始下山,就不再向上走了。队员们希望在满足上面条件的同时,尽可能多的浏览景点,你能帮他们找出最多可能浏览的景点数么?InputLine 1: N (2 <= N <= 1000) 景点数Line 2: N个整数,每个景点的海拔Output最多能浏览.原创 2021-04-06 20:57:06 · 91 阅读 · 0 评论 -
贪心-覆盖问题-圆心位置的判别
Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the coasting, can only cover d distance, so an island in the原创 2021-02-01 11:26:26 · 226 阅读 · 0 评论 -
贪心-区间覆盖-喷水装置
n sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkler is installed at the horizontal center line of the strip. For each sprinkler we are given its position as the distance from the left end of the center原创 2020-09-25 14:59:27 · 116 阅读 · 0 评论 -
贪心-连续问题
Iahub got bored, so he invented a game to be played on paper.He writesnintegersa1, a2, ..., an. Each of those integers can be either 0 or 1. He's allowed to do exactly one move: he chooses two indicesiandj(1 ≤ i ≤ j ≤ n) and flips all valuesa...原创 2020-07-20 18:09:01 · 147 阅读 · 0 评论