
贪心
有关贪心的题目
随意凯
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
poj 2010 Moo University - Financial Aid——优先队列+贪心(详细注释)
Description Bessie noted that although humans have many universities they can attend, cows have none. To remedy this problem, she and her fellow cows formed a new university called The University of Wisconsin-Farmside,“Moo U” for short. Not wishing to admi原创 2020-05-26 18:47:16 · 245 阅读 · 0 评论 -
POJ 3614 Sunscreen——贪心与优先队列的完美结合
Description To avoid unsightly burns while tanning, each of the C (1 ≤ C ≤ 2500) cows must cover her hide with sunscreen when they’re at the beach. Cow i has a minimum and maximum SPF rating (1 ≤ minSPFi ≤ 1,000; minSPFi ≤ maxSPFi ≤ 1,000) that will work.原创 2020-05-25 11:22:16 · 273 阅读 · 0 评论 -
POJ 2229 Sumsets——动态规划
此题目采用两种方式解决,一种是完全背包解法,另一种是数学方法原创 2020-05-05 22:17:44 · 199 阅读 · 0 评论 -
POJ 3040 Allowance——经典贪心算法题目
本题是一道经典的纯运用贪心算法思想的题目原创 2020-05-04 12:15:56 · 1053 阅读 · 0 评论 -
POJ1017 Packets——理解贪心的经典题目
通过这道题理解贪心的思想原创 2020-05-03 23:51:22 · 220 阅读 · 0 评论 -
POJ Stall Reservations——贪心区间+优先队列
利用优先队列来完成贪心算法,极大的减小了时间复杂度和代码实现难度原创 2020-05-01 09:59:59 · 169 阅读 · 0 评论 -
POJ Radar Installation——贪心算法(区间)
我直接说这道题题目重点:x轴是雷达所在位置,x轴以上是海,以下是陆地,海上有岛屿,雷达半径为r,问最少需要多少雷达可实现全覆盖岛屿。 错误的思路 这是我第一次想的方法,就是对每一个岛屿找到当前岛屿所能对应的雷达的最大值,再看有多少岛屿可以被覆盖,下一次从未被覆盖的第一个岛屿开始继续贪心。 但这种方法无法解决下面这个例子: 2 5 -5 3 -3 5 会发现第一个对应的最大雷达位置是-1,但是(-...原创 2020-04-30 21:45:25 · 207 阅读 · 0 评论