贪心
文章平均质量分 58
_IanXiao
这个作者很懒,什么都没留下…
展开
-
ZOJ1025 Wooden Sticks
题目:Description There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs som原创 2016-02-13 13:15:05 · 804 阅读 · 0 评论 -
LeetCode55. Jump Game
题目: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.Determine if you原创 2016-02-16 21:23:23 · 377 阅读 · 0 评论 -
LeetCode45. 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 is to r原创 2016-02-16 21:29:48 · 375 阅读 · 0 评论 -
LeetCode122. Best Time to Buy and Sell Stock II
题目链接: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ 题目描述:用一个数组表示股票每天的价格,数组的第i个数表示股票在第i天的价格。交易次数不限,但一次只能交易一支股票,也就是说手上最多只能持有一支股票,求最大收益。思路:嗯,与之前不同的是不限交易次数。很基础的贪心,只要当天卖掉的价格减去前一天买入的价格,原创 2016-02-04 20:16:20 · 479 阅读 · 0 评论 -
LeetCode134. Gas Station
题目:There 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 travel from station i to its原创 2016-02-20 23:01:53 · 426 阅读 · 0 评论 -
nyoj448 寻找最大数
题目:描述 请在整数 n 中删除m个数字, 使得余下的数字按原次序组成的新数最大,比如当n=92081346718538,m=10时,则新的最大数是9888输入 第一行输入一个正整数T,表示有T组测试数据 每组测试数据占一行,每行有两个数n,m(n可能是一个很大的整数,但其位数不超过100位,并且保证数据首位非0,m小于整数n的位数)输出 每组测试数据的输出占一行,输出剩余的数字按原次序组成原创 2016-02-26 20:59:17 · 554 阅读 · 0 评论