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-10-19 22:35:19
阅读次数:
165
Choose the best routeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7361Accepted Submission(s): 2...
分类:
其他好文 时间:
2014-10-19 15:30:34
阅读次数:
279
知道是求连续最大子数组后就简单了。但是注意边界条件,如果最大子数组之和<0,那就不要交易了, 返回0.
public class Solution {
public int maxProfit(int[] prices) {
if(prices.length < 2)
return 0;
int n = prices....
分类:
其他好文 时间:
2014-10-19 00:06:49
阅读次数:
146
明白了上一题是求最大的连续子数组之和后,这题就更加简单了,遇到小于0的就不要加。
public class Solution {
public int maxProfit(int[] prices) {
if(prices.length < 2)
return 0;
int n = prices.length;
...
分类:
其他好文 时间:
2014-10-19 00:05:52
阅读次数:
194
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-10-18 22:14:23
阅读次数:
151
静态NAT
Router(config)#ip nat inside source static tcp 192.168.100.2 61.159.62.131 指定地址转换映射
Router(config)#ip nat inside source static tcp192.168.100.3 61.159.62.132 指定地址转换映射
在内部和外部接口上启用NAT
Rout...
分类:
其他好文 时间:
2014-10-17 18:51:13
阅读次数:
239
题目描述: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 transactio...
分类:
其他好文 时间:
2014-10-17 02:09:43
阅读次数:
293
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 complet...
分类:
其他好文 时间:
2014-10-16 21:34:53
阅读次数:
240
http://www.codeproject.com/Articles/687061/Multiple-Models-in-a-View-in-ASP-NET-MVC-MVChttp://www.codeproject.com/Articles/717941/How-to-Choose-the-Be...
分类:
Web程序 时间:
2014-10-16 21:07:43
阅读次数:
210