版权所有,欢迎转载,转载请注明出处,谢谢
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sel...
分类:
其他好文 时间:
2015-02-06 13:22:16
阅读次数:
121
这道题想了很多,但是想多了。这个题思路很简单,如果当前值大于最小值,就计算差,和最大利润值比较。 1 class Solution { 2 public: 3 int maxProfit(vector &prices) { 4 if(prices.size()==0) 5 ...
分类:
其他好文 时间:
2015-02-04 21:34:21
阅读次数:
120
HDU 1847 Good Luck in CET-4 Everybody!(SG的简单运用)...
分类:
其他好文 时间:
2015-02-04 20:27:53
阅读次数:
148
Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),...
分类:
其他好文 时间:
2015-02-04 18:49:28
阅读次数:
123
Railway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…
The Lunar New Year was approaching, but unluckily the Little Cat still had schedules going here and there. Now, he had to travel by tra...
分类:
其他好文 时间:
2015-02-03 09:37:13
阅读次数:
222
标题:Best Time to Buy and Sell Stock II通过率:37.3%难度:中等Say you have an array for which theithelement is the price of a given stock on dayi.Design an algor...
分类:
其他好文 时间:
2015-02-02 12:28:59
阅读次数:
124
标题:Best Time to Buy and Sell Stock通过率:32%难度:中等Say you have an array for which theithelement is the price of a given stock on dayi.If you were only per...
分类:
其他好文 时间:
2015-02-02 12:18:58
阅读次数:
138
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
编程语言 时间:
2015-02-01 10:46:16
阅读次数:
251
思路:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ...
分类:
编程语言 时间:
2015-01-31 21:47:24
阅读次数:
180
Description Dragon loves lottery, he will try his luck every week. One day, the lottery company brings out a new form of lottery called accumulated...
分类:
其他好文 时间:
2015-01-31 14:33:10
阅读次数:
190