Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on...
分类:
编程语言 时间:
2014-07-24 10:25:36
阅读次数:
227
class Solution {public: int maxProfit(vector &prices) { int len = prices.size(); if (len i2r(len, 0); vector i2l(len, 0); ...
分类:
其他好文 时间:
2014-07-22 22:34:54
阅读次数:
154
Problem Description
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in...
分类:
其他好文 时间:
2014-07-20 23:01:28
阅读次数:
271
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 complete a...
分类:
其他好文 时间:
2014-07-20 21:33:36
阅读次数:
204
Marbles
Input: standard input
Output: standard output
I have some (say, n) marbles (small glass balls) and I am going to buy some boxes to store them. The boxes are of two types:
Type 1: each ...
分类:
其他好文 时间:
2014-07-19 08:01:10
阅读次数:
264
DescriptionRailway 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 ...
分类:
其他好文 时间:
2014-07-18 18:17:12
阅读次数:
280
[LeetCode]Best Time to Buy and Sell Stock II...
分类:
其他好文 时间:
2014-07-16 17:32:35
阅读次数:
181
ay 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 complete at...
分类:
其他好文 时间:
2014-07-13 23:22:16
阅读次数:
294
sql中有group buy 后如何获取总记录的条数,来生成分页当然一般情况下我是不推荐这样的分页,如果你真的需要应该是你表结构设计有问题1、适用于所有情况$db = new PDO(DSN...); $db->setAttribute(array(PDO::MYSQL_USE_BUFFERED_Q...
分类:
其他好文 时间:
2014-07-13 21:41:23
阅读次数:
271
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You ma...
分类:
其他好文 时间:
2014-07-13 13:55:14
阅读次数:
305