码迷,mamicode.com
首页 >  
搜索关键字:choose the best rout    ( 3445个结果
leetcode -- Best Time to Buy and Sell Stock
class Solution {public: int maxProfit(vector &prices) { if(prices.size() == 0) return 0; vector f1(prices.size()); int minV = pri...
分类:其他好文   时间:2014-05-30 02:54:28    阅读次数:231
leetcode -- Best Time to Buy and Sell Stock II
class Solution {public: int maxProfit(vector &prices) { if(prices.size() == 0) return 0; vector f(prices.size()); f[0] = 0; ...
分类:其他好文   时间:2014-05-30 02:46:12    阅读次数:318
Weka--Explorer基本流程
点击Open file导入arff格式的数据,这里我导入weka内置的weather.numeric.arff数据集查看preprocess右边的三个按钮,分别是分类、聚类、关联分析,选择你需要使用的功能这里我选择分类,点击choose按钮选择要使用的分类方法这里选择j48,一种决策树算法,再点击s...
分类:其他好文   时间:2014-05-29 22:57:28    阅读次数:462
Leetcode: Best Time to Buy and Sell Stock
My original thought was to calculate all the possible transactions by using nested loop. But got time limit excess error.I knew it can be done in O(n)...
分类:其他好文   时间:2014-05-29 20:44:37    阅读次数:271
Leetcode: Best Time to Buy and Sell Stock II
一次过,思路是:最大收益可以由所有上升序列差价叠加中获得 1 public class Solution { 2 public int maxProfit(int[] prices) { 3 int profit = 0; 4 if (prices.lengt...
分类:其他好文   时间:2014-05-29 20:43:33    阅读次数:254
LeetCode123:Best Time to Buy and Sell Stock III
题目: 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 co...
分类:其他好文   时间:2014-05-28 22:37:18    阅读次数:327
【百度之星2014~初赛解题报告】
最近要毕业了,有半年没做比赛了.这次参加百度之星的初赛娱乐一下.现在写一下解题报告.还是先看看四道题的类型吧1.Scenic Popularity 暴力 复杂度O( 100 * 100 * 10000 ) 或者O( T * K * R) 线段树2.Chess DP 复杂度 O(n^2)3.Best ...
分类:其他好文   时间:2014-05-28 13:19:16    阅读次数:261
[leetcode]_Best Time to Buy and Sell Stock I && II
一个系列三道题,我都不会做,google之答案。过了两道,第三道看不懂,放置,稍后继续。一、Best Time to Buy and Sell Stock I题目:一个数组表示一支股票的价格变换。要求只买卖一次,获得最大收益。思路:一开始我认为是寻找最大、最小值,但由于最大值不一定总是出现在最小值的...
分类:其他好文   时间:2014-05-28 01:21:52    阅读次数:262
LeetCode121:Best Time to Buy and Sell Stock
题目: 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 transac...
分类:其他好文   时间:2014-05-28 00:55:20    阅读次数:288
LeetCode122:Best Time to Buy and Sell Stock II
题目: 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 co...
分类:其他好文   时间:2014-05-28 00:53:26    阅读次数:338
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!