码迷,mamicode.com
首页 >  
搜索关键字:maximum subsequence    ( 5146个结果)
1007. Maximum Subsequence Sum (25)
Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1 <= i <= j <= K. The Maximum Subsequence is the continuous subsequence which...
分类:其他好文   时间:2015-02-24 12:36:31    阅读次数:120
LeetCode 152. Maximum Product Subarray
动态规划。 dp[0][i]: A[0, ..., i-1]的maximum product subarray, dp[1][i]: A[0, ..., i-1)的minimum product subarray. 初始化dp[0][0] = dp[1][0] = A[0]. 递推公式: dp[0][i] = max(dp[0][i-1]*A[i], dp[1][i-1]*A[i])...
分类:其他好文   时间:2015-02-23 20:08:09    阅读次数:163
[LeetCode] Best Time to Buy and Sell Stock IV
Say you have an array for which the ithi^{th} element is the price of a given stock on day ii.Design an algorithm to find the maximum profit. You may complete at most k transactions.Note: You may not...
分类:其他好文   时间:2015-02-23 00:16:37    阅读次数:174
[LeetCode] Best Time to Buy and Sell Stock III
Say you have an array for which the ithi^{th} element is the price of a given stock on day ii.Design an algorithm to find the maximum profit. You may complete at most two transactions.Note: You may no...
分类:其他好文   时间:2015-02-22 18:31:15    阅读次数:181
动态规划---最长上升子序列问题(O(nlogn),O(n^2))
LIS(Longest Increasing Subsequence)最长上升子序列 或者 最长不下降子序列。很基础的题目,有两种算法,复杂度分别为O(n*logn)和O(n^2) 。**********************************************************...
分类:其他好文   时间:2015-02-20 22:00:21    阅读次数:245
Codeforces Round #221 (Div. 2) D. Maximum Submatrix 2 (思维题)
题目地址:codeforces 221 D 这场是人生中做的第一场CF中的D题。(当时只做出来了A题。。)过年之际回顾了一下,就顺便看了几道D题。现在做CF的D题在比赛时还是做不出来。但是赛后往往都可以自己做出来。据说D题能在比赛中稳出的话就可以区域赛银了。于是争取以后CF能稳出4道题吧。 这道题刚开始不该看标签的。。给的是DP。。于是就一直朝着DP方向想。但是感觉不像是DP。就换了个思路,就做...
分类:其他好文   时间:2015-02-20 20:54:25    阅读次数:178
[LeetCode] Best Time to Buy and Sell Stock IV 买卖股票的最佳时间之四
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...
分类:其他好文   时间:2015-02-18 15:11:36    阅读次数:142
leetcode 104. Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2015-02-17 19:54:58    阅读次数:146
R语言中文分词jiebaR
简介“结巴”中文分词的R语言版本,支持最大概率法(Maximum Probability), 隐式马尔科夫模型(Hidden Markov Model), 索引模型(QuerySegment), 混合模型(MixSegment), 共四种分词模式, 同时有词性标注,关键词提取,文本Simhash相似度比较等功能。项目使用了Rcpp和CppJieba进行开发。特性支持 Windows , Linux操...
分类:编程语言   时间:2015-02-17 11:42:32    阅读次数:376
leetcode_104_Maximum Depth of Binary Tree
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢 Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to...
分类:其他好文   时间:2015-02-17 10:25:14    阅读次数:168
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!