码迷,mamicode.com
首页 >  
搜索关键字:maximum subsequence    ( 5146个结果
最长上升子序列
Problem Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), where 1 <= i1 ...
分类:其他好文   时间:2014-07-25 11:04:41    阅读次数:253
[ACM] POJ 3061 Subsequence (尺取法)
Subsequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8403   Accepted: 3264 Description A sequence of N positive integers (10 < N < 100 000), each of...
分类:其他好文   时间:2014-07-24 10:27:40    阅读次数:215
【LeetCode】【Python题解】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...
分类:编程语言   时间:2014-07-24 10:25:36    阅读次数:227
URAL 1146 Maximum Sum(最大子矩阵的和 DP)
Maximum Sum大意:给你一个n*n的矩阵,求最大的子矩阵的和是多少。思路:最开始我想的是预处理矩阵,遍历子矩阵的端点,发现复杂度是O(n^4),就不知道该怎么办了。问了一下,是压缩矩阵,转换成最大字段和的问题。压缩行或者列都是可以的。 1 int n, m, x, y, T, t; 2 in...
分类:其他好文   时间:2014-07-24 07:10:58    阅读次数:211
URAL 1146 Maximum Sum(最大子矩阵的和 DP)
Maximum Sum 大意:给你一个n*n的矩阵,求最大的子矩阵的和是多少。 思路:最开始我想的是预处理矩阵,遍历子矩阵的端点,发现复杂度是O(n^4),就不知道该怎么办了。问了一下,是压缩矩阵,转换成最大字段和的问题。 压缩行或者列都是可以的。 int n, m, x, y, T, t; int Map[1010][1010]; int m...
分类:其他好文   时间:2014-07-23 20:54:55    阅读次数:324
HDU-4632 http://acm.hdu.edu.cn/showproblem.php?pid=4632
http://acm.hdu.edu.cn/showproblem.php?pid=4632题意:一个字符串,有多少个subsequence是回文串。别人的题解:用dp[i][j]表示这一段里有多少个回文串,那首先dp[i][j]=dp[i+1][j]+dp[i][j-1],但是dp[i+1][j]...
分类:Web程序   时间:2014-07-23 16:31:51    阅读次数:365
LeetCode OJ平台上Maximum Subarray题目O(n)复杂度解决方式
原始题目例如以下,意为寻找数组和最大的子串,返回这个最大和就可以。Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, ...
分类:其他好文   时间:2014-07-23 15:45:59    阅读次数:246
【leetcode刷题笔记】Distinct Subsequences
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
分类:其他好文   时间:2014-07-23 12:36:06    阅读次数:209
Leet code —Jump Game
问题描述: 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. Determin...
分类:其他好文   时间:2014-07-23 00:04:37    阅读次数:216
HDU 1159 Common Subsequence (动规+最长公共子序列)
HDU 1159 Common Subsequence (动规) 最长公共子序列的模板题目。...
分类:其他好文   时间:2014-07-22 17:58:41    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!