码迷,mamicode.com
首页 >  
搜索关键字:a subsequence of a g    ( 1119个结果
HDU 1159 Common Subsequence--DP--(转化成矩阵)
题意:找最长公共子序列(不要求连续) 分析:二维dp肯定的,不过我自己用的四层循环,超时;正解是画矩阵,找规律。以后要多注意这种思想          WA了很多遍,原因:1.对数组边界的处理;2.while(1)超时,改成while(cin>>a>>b)就过了 代码: #include #include #define max(a,b) a>b?a:b using namespace s...
分类:其他好文   时间:2015-06-07 15:50:06    阅读次数:110
【leetcode】Distinct Subsequences
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 from th...
分类:其他好文   时间:2015-06-07 12:28:40    阅读次数:78
Maximum Subsequence Sum (25)
升级版的最大子列和问题没什么好说的#include using namespace std;int main(){ int n; cin >> n; int *a = (int*)malloc(n*sizeof(int)); for (int i = 0; i > a[i];...
分类:其他好文   时间:2015-06-04 22:38:40    阅读次数:191
【Distinct Subsequences】cpp
题目: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 o...
分类:其他好文   时间:2015-06-04 21:03:00    阅读次数:130
尺取法 POJ 3601 Subsequence
题目传送门 1 /* 2 题意:求连续子序列的和不小于s的长度的最小值 3 尺取法:对数组保存一组下标(起点,终点),使用两端点得到答案 4 1. 记录前i项的总和,求[i, p)长度的最小值,用二分找到sum[p] - s[i] >= s的p 5 2...
分类:其他好文   时间:2015-06-03 21:26:58    阅读次数:161
NYOJ 36 最长公共子序列 (还是dp)
这个好多算法书上都有,不仅限于《算法导论》 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述 咱们就不拐弯抹角了,如题,需要你做的就是写一个程序,得出最长公共子序列。 tip:最长公共子序列也称作最长公共子串(不要求连续),英文缩写为LCS(Longest Common Subsequence)。其定义是,一个序列 S ...
分类:其他好文   时间:2015-06-03 15:54:35    阅读次数:124
poj 3061 Subsequence
题目连接http://poj.org/problem?id=3061SubsequenceDescriptionA sequence of N positive integers (10 2 #include 3 #include 4 #include 5 #include 6 using std....
分类:其他好文   时间:2015-06-01 22:07:52    阅读次数:95
POJ_3061 && POJ_3320 (尺取法)
Subsequence Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9587   Accepted: 3855 Description A sequence of N positive integers (10 < N < 100 000), each of the...
分类:其他好文   时间:2015-05-28 09:43:33    阅读次数:143
[LintCode] Longest Increasing Continuous subsequence II
http://www.lintcode.com/en/problem/longest-increasing-continuous-subsequence-ii/# Give you an integer matrix (with row size n, column size m),find the...
分类:其他好文   时间:2015-05-26 17:54:40    阅读次数:123
[LintCode] Longest Increasing Continuous subsequence
http://www.lintcode.com/en/problem/longest-increasing-continuous-subsequence/# Give you an integer array (index from 0 to n-1, where n is the size of ...
分类:其他好文   时间:2015-05-26 12:19:11    阅读次数:144
1119条   上一页 1 ... 82 83 84 85 86 ... 112 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!