码迷,mamicode.com
首页 >  
搜索关键字:sell stock iv    ( 3393个结果
LeetCode - Best Time to Buy and Sell 3
这道题在前两个的基础上做稍微改进就可以。下面是AC代码: 1 /** 2 * Design an algorithm to find the maximum profit. You may complete at most two transactions. 3 * @pa...
分类:其他好文   时间:2014-07-22 23:01:13    阅读次数:251
获取远程json数据,ja数据的小总结
1.如果要获得 http://hq.sinajs.cn/rn=61fdj&format=text&list=stock_sh_up_5min_20 输出的数据打开链接,可以看到输出的是 stock_sh_up_5min_20 = ...也就是说服务器返回的是一段js代码,所以我们在本地建立一个,并把...
分类:Web程序   时间:2014-05-06 10:27:29    阅读次数:448
[leetcode] Best Time to Buy and Sell Stock II
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-05-06 00:51:29    阅读次数:353
[ACM] hdu 1029 Ignatius and the Princess IV (动归或hash)
Ignatius and the Princess IV Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32767K (Java/Other) Total Submission(s) : 7   Accepted Submission(s) : 3 Font: Times New Roman | Verdana | ...
分类:其他好文   时间:2014-05-05 13:01:52    阅读次数:325
[leetcode] Best Time to Buy and Sell Stock III
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-05-03 23:21:20    阅读次数:292
[leetcode] Best Time to Buy and Sell Stock
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 (ie...
分类:其他好文   时间:2014-05-02 00:37:20    阅读次数:349
LeetCode - Best Time to Buy and Sell 2
这道题我一开始想到用递归方法,可以把规模大的问题变成规模小的问题,但是觉得递归的时间复杂度很高,因为它会把相同的问题进行重复计算,然后我想是不是有什么down-up的方法,先把所有的子问题的结果保存起来,但是发现问题的最优解并不能由子问题的最优解推导出来。最后就想到买股票的时候,我们在一个局部极小的...
分类:其他好文   时间:2014-05-01 19:24:02    阅读次数:250
STL 之 map 源码剖析
/* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, ...
分类:其他好文   时间:2014-04-29 13:28:21    阅读次数:398
leetcode day6 -- String to Integer (atoi) && Best Time to Buy and Sell Stock I II III
1、 ?? String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yours...
分类:其他好文   时间:2014-04-29 13:22:22    阅读次数:341
STL 之 multimap 源码剖析
/* * * Copyright (c) 1994 * Hewlett-Packard Company * * Permission to use, copy, modify, distribute and sell this software * and its documentation for any purpose is hereby granted without fee, ...
分类:其他好文   时间:2014-04-29 13:13:21    阅读次数:309
3393条   上一页 1 ... 337 338 339 340 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!