![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
贪心策略
Guapifang
这个作者很懒,什么都没留下…
展开
-
PAT甲级 1033 To Fill or Not to Fill (25分)--贪心策略
**1033 To Fill or Not to Fill (25分)**With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas stations on the way from time to time. Different gas station may gi原创 2020-08-13 10:04:11 · 131 阅读 · 0 评论 -
LeetCode 45. 跳跃游戏 II---贪心算法
给定一个非负整数数组,你最初位于数组的第一个位置。数组中的每个元素代表你在该位置可以跳跃的最大长度。你的目标是使用最少的跳跃次数到达数组的最后一个位置。示例:输入: [2,3,1,1,4]输出: 2解释: 跳到最后一个位置的最小跳跃数是 2。从下标为 0 跳到下标为 1 的位置,跳 1 步,然后跳 3 步到达数组的最后一个位置。说明:假设你总是可以到达数组的最后一个位置。来源:...原创 2020-05-04 23:17:51 · 311 阅读 · 0 评论