![](https://img-blog.csdnimg.cn/20190927151101105.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
贪心
该专栏包括的题目涉及贪心算法。
XiaoZheng2003
博客暂时弃更
展开
-
排座椅
一、原题排座椅(seat.cpp)时间限制: 1 Sec 内存限制: 64 MB题目描述上课的时候总有一些同学和前后左右的人交头接耳,这是令小学班主任十分头疼的一件事情。不过,班主任小雪发现了一些有趣的现象,当同学们的座次确定下来之后,只有有限的D对同学上课时会交头接耳。同学们在教室中坐成了M行N列,坐在第i行第j列的同学的位置是(i,j),为了方便同学们进出,在教室中设置了K条横向的通道,L条纵原创 2016-11-01 13:32:37 · 2824 阅读 · 0 评论 -
NOIP2016年普及组模拟考试(9.3) 2.笨笨的西瓜种植
一、原题2.笨笨的西瓜种植(watermelon.cpp) 【题目描述】笨笨种了一块西瓜地,但这块西瓜地的种植范围是一条直线的…… 笨笨在一番研究过后,得出了m个结论,这m个结论可以使他收获的西瓜最多。 笨笨的结论是这样的: 从西瓜地B处到E处至少要种植T个西瓜,这个范围的收获就可以最大化。 笨笨不想那么辛苦,所以他想种植的西瓜尽量少,而又满足每一个所得的结论。【输入】第一行两原创 2016-09-06 13:27:10 · 2380 阅读 · 0 评论 -
【贪心】【模拟】[POJ2709][HDU2730]Painter
DescriptionThe local toy store sells small fingerpainting kits with between three and twelve 50ml bottles of paint, each a different color. The paints are bright and fun to work with, and have the usef原创 2017-07-13 09:46:04 · 843 阅读 · 0 评论 -
【贪心】【模拟】[POJ1877]Flooded!
DescriptionTo enable homebuyers to estimate the cost of flood insurance, a real-estate firm provides clients with the elevation of each 10-meter by 10-meter square of land in regions where homes may原创 2017-07-14 12:33:31 · 600 阅读 · 0 评论 -
【贪心】[POJ1328]Radar Installation
DescriptionAssume 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, locati原创 2017-07-14 14:38:49 · 426 阅读 · 0 评论 -
【贪心】【树形DP】[POJ1463][HDU1054]Strategic game 战略游戏
DescriptionBob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend原创 2017-07-15 16:59:42 · 831 阅读 · 1 评论 -
【贪心】【枚举】【重庆市NOIP模拟赛】旅行
题目描述Mr_H 旗下的 n 个 OIer 坐船外出旅行! 但是他们只有一艘船,虽然船能装下全部的 Oier,但太拥挤将会影响众 OIer 的心情,所以 Mr_H 决定选择一部分 Oier 去。我们假设,每个人单独坐船的快乐程度是 Ci,而船上每多一个人,他的快乐程度会减去 Di。 现在你的任务是帮助 Mr_H 计算,选择那些人,才能使船上所有人的快乐程度之和达到最大。输入第1行是一个整数 n,原创 2017-07-24 17:00:36 · 787 阅读 · 0 评论