题意:求最长递增子序列 AC代码:#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int dp[1010],a[1010]; int main() { int i,j,n; scanf("%d ...
分类:
其他好文 时间:
2017-04-21 21:31:08
阅读次数:
135
题目链接:http://acm.csu.edu.cn/csuoj/problemset/problem?pid=1553 Description Give you a sequence of n numbers, and a number k you should find the max leng ...
分类:
其他好文 时间:
2017-04-21 20:22:52
阅读次数:
238
最长上升子序列 一个数的序列 a i ,当 a 1 < a 2 < # < a N 时,称这个序列是上升的。对于给定的一个序列 ( a 1 , a 2 ,# , a N ),可以得到一些上升子序列( a i1 , a i 2 ,# , a iK ),这里 1 ≤ i1 < i 2 < # < iK ...
分类:
其他好文 时间:
2017-04-21 00:05:24
阅读次数:
211
Common Subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 38003 Accepted Submission(s): ...
分类:
其他好文 时间:
2017-04-20 16:10:43
阅读次数:
164
题意:给出n个数,求最大连续的子区间和,并且输出该区间的第一个和最后一个数。 如果所有数都小于0,那么则输出0,第一个数和最后一个数。 看数据k的范围,就知道肯定不能两层for循环来求区间和,O(n^2)的复杂度肯定超时所以这里肯定要求一遍for循环就能知道结果定义区间l和r,sum为目前[l,r] ...
分类:
其他好文 时间:
2017-04-18 16:08:53
阅读次数:
213
本文解决最大子序列和问题,有两个题目组成,第二个题目比第一个要求多一些(其实就是要求输出子序列首尾元素)。 01-复杂度1 最大子列和问题 (20分) 给定KK个整数组成的序列{ N1??, N2??, ..., NK?? },“连续子列”被定义为{ N?i??, Ni+1 ..., Nj },其中 ...
分类:
其他好文 时间:
2017-04-17 10:07:11
阅读次数:
216
转载请注明出处:http://blog.csdn.net/u012860063 最长递增子序列(Longest Increasing Subsequence)以下我们简记为:LIS。 如果存在一个序列d[1..9] = 2 1 5 3 6 4 8 9 7,我们能够非常轻松的看出来它的LIS长度为5。 ...
分类:
其他好文 时间:
2017-04-15 20:27:22
阅读次数:
153
题目 Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed fro ...
分类:
其他好文 时间:
2017-04-15 18:23:25
阅读次数:
178
本周课堂上学习的是动态规划,因此在LeetCode上找到相应的题进行练习。 题目: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum le ...
分类:
其他好文 时间:
2017-04-10 12:19:14
阅读次数:
163
Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as the longest subs ...
分类:
其他好文 时间:
2017-04-08 00:25:01
阅读次数:
286