码迷,mamicode.com
首页 >  
搜索关键字:a subsequence of a g    ( 1119个结果
POJ 1458 && HDU 1159 Common Subsequence (最長公共子序列)dp
鏈接: http://poj.org/problem?id=1458 Description: A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z =...
分类:其他好文   时间:2014-10-13 16:43:09    阅读次数:257
POJ 1458-Common Subsequence(线性dp/LCS)
Common Subsequence Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 39009   Accepted: 15713 Description A subsequence of a given sequence is the given sequenc...
分类:其他好文   时间:2014-10-13 15:02:29    阅读次数:213
poj 1458 Common Subsequence
题目链接:http://poj.org/problem?id=1458思路: 经典的最长公共子序列问题,使用动态规划解题。代码:#include #include using namespace std;const int MAX_N = 200 + 10;int dp[MAX_N][MAX_N]....
分类:其他好文   时间:2014-10-11 02:14:34    阅读次数:201
数论(同余+hash)
Time Limit:3000MS Memory Limit:65536KB Description You are given a sequence a[0]a[1] ... a[N-1] of digits and a prime number Q. For each i<=j with a[i] != 0, the subsequence a[i]a[i+1]...a[j] can be...
分类:其他好文   时间:2014-10-10 22:24:14    阅读次数:256
Common Subsequence 最大公共子序列问题
Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another ....
分类:其他好文   时间:2014-10-09 21:57:27    阅读次数:219
Palindromic Subsequence(最长回文字符串 输出路径)
初看好简单   一开始调试着一直re   后来也不知道怎么就对了  但是还有一些bug存在   , 这道题的打印路径和light oj An Easy LCS(ps:点击打开链接)一样 但是只改一下会Tle  因为(1000*1000*1000)好大 但是把存储的字符串改为string 定义的就过了 但是还是有一点有点难受(下面会说出) 我也是醉了 #include #include...
分类:其他好文   时间:2014-10-07 02:36:42    阅读次数:405
nlog(n)解动态规划--最长上升子序列(Longest increasing subsequence)
最长上升子序列LIS问题属于动态规划的初级问题,用纯动态规划的方法来求解的时间复杂度是O(n^2)。但是如果加上二叉搜索的方法,那么时间复杂度可以降到nlog(n)。 具体分析参考:http://blog.chinaunix.net/uid-26548237-id-3757779.html 代...
分类:其他好文   时间:2014-10-05 22:41:09    阅读次数:194
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 the original string by deleting some (can be non...
分类:其他好文   时间:2014-10-02 16:03:39    阅读次数:188
poj3061 Subsequence&&poj3320 Jessica's Reading Problem(尺取法)
这两道题都是用的尺取法。尺取法是《挑战程序设计竞赛》里讲的一种常用技巧。就是O(n)的扫一遍数组,扫完了答案也就出来了,这过程中要求问题具有这样的性质:头指针向前走(s++)以后,尾指针(t)要么不动要么也往前走。满足这种特点的就可以考虑尺取法。poj3061 比较简单,也可以用二分做,时间复杂度O...
分类:其他好文   时间:2014-09-25 02:11:38    阅读次数:245
1007. Maximum Subsequence Sum (25)——PAT (Advanced Level) Practise
题目信息: 1007. Maximum Subsequence Sum (25) 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue Given a sequence of K i...
分类:其他好文   时间:2014-09-24 11:12:56    阅读次数:364
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!