贪心
文章平均质量分 56
liuchenjane
这个作者很懒,什么都没留下…
展开
-
Queue Reconstruction by Height
Queue Reconstruction by HeightSuppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is转载 2016-09-28 21:03:43 · 1844 阅读 · 0 评论 -
45. Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal i转载 2017-01-15 16:38:54 · 211 阅读 · 0 评论 -
134. Gas Station
134. Gas StationThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to trave转载 2016-11-02 16:32:21 · 286 阅读 · 0 评论 -
455. Assign Cookies
Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a c原创 2016-11-13 16:54:45 · 1172 阅读 · 0 评论 -
452. Minimum Number of Arrows to Burst Balloons
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordin原创 2016-11-11 21:20:13 · 411 阅读 · 0 评论 -
436. Find Right Interval
436. Find Right IntervalGiven a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point of the interv原创 2016-10-30 16:42:27 · 1253 阅读 · 0 评论 -
435. Non-overlapping Intervals
435. Non-overlapping IntervalsGiven a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note:You原创 2016-10-30 16:33:26 · 1764 阅读 · 2 评论 -
单位时间任务调度
问题:假设任务都可以在单位时间内完成,它们每一个任务都有最后的截止时间,如果超时,就会有惩罚。想尽可能减少惩罚。//用贪心算法的拟阵解决单处理器上带截至时间和惩罚的单位时间任务调度问题#include #include #include #include using namespace std;const int Max=7;const int d[Max]={4,2,4,3,原创 2016-11-05 09:12:39 · 2405 阅读 · 0 评论 -
376. Wiggle Subsequence
376. Wiggle SubsequenceA sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if原创 2016-10-13 15:25:07 · 246 阅读 · 0 评论 -
625. Minimum Factorization
Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a.If there is no answer or the answer is not fit in 32-bit signed integer, then return原创 2017-06-21 15:17:42 · 814 阅读 · 0 评论