码迷,mamicode.com
首页 >  
搜索关键字:maximum subsequence    ( 5146个结果)
Jump Game--LeetCode
题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. De...
分类:其他好文   时间:2015-04-07 19:42:29    阅读次数:108
Best Time to Buy and Sell Stock IV
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 k transactions. Note: You may not ...
分类:其他好文   时间:2015-04-07 10:03:35    阅读次数:154
求最长公共子序列长度
poj 1458 Common Subsequence http://poj.org/problem?id=1458问题分析:这个题是求两个序列的最长公共最序列长度,在这里要弄清楚两个问题1:本题中所有的子序列并没有要求是连续子序列,所以在求2:哪部分子序列才是最长的 对于给定的X =...
分类:其他好文   时间:2015-04-07 00:40:57    阅读次数:107
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-04-06 15:29:04    阅读次数:223
Leetcode: 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 complete as many transactions as you like (ie, buy on...
分类:其他好文   时间:2015-04-05 23:34:42    阅读次数:180
CodeForces 484B Maximum Value
1 #include 2 #include 3 #include 4 #include 5 #include 6 #define sc(x) scanf("%d", &x) 7 #define sc2(x,y) scanf("%d%d", &x, &y) 8 #define pf...
分类:其他好文   时间:2015-04-05 23:28:19    阅读次数:165
Leetcode #152 Maximum Product Subarray
题目链接:https://leetcode.com/problems/maximum-product-subarray/较麻烦的解法:先判断数组中有没有0,有的话可以转换为求"0之前"和"0之后"两部分的较大值。遍历,记录数组中负数的个数:偶数:由于数组中都是整数,最大值即这些值的乘积。奇数:有以下...
分类:其他好文   时间:2015-04-05 23:22:57    阅读次数:164
Leetcode #124 Binary Tree Maximum Path Sum
题目链接:https://leetcode.com/problems/binary-tree-maximum-path-sum/题中要求 maxPathSum(TreeNode *root)函数返回二叉树中最大的"Path Sum"。而这个最大的"Path Sum"可以被分解为三部分之和:"左子树的...
分类:其他好文   时间:2015-04-05 23:11:44    阅读次数:158
[ACM] CSU 1553 Good subsequence(尺取法)
题目地址:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1553 给定n的数的序列,求最长连续区间满足区间内的数最大值与最小值的差 (尺取法) const int maxn=10010; int num[maxn]; int n,k; int MIN,MAX; int main() { while(scanf("%d%d",&n,&...
分类:其他好文   时间:2015-04-05 20:30:41    阅读次数:259
【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...
分类:其他好文   时间:2015-04-05 17:26:22    阅读次数:131
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!