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-05-30 15:58:40
阅读次数:
187
题目:给定三个串str1,str2,str3,判断str3是否是str1,str2的交叉字符串。
交叉字符串:两个字符串的字符交叉,组成新的字符串,要求属于原来字符串中的字符在新的生成的交叉字符串中的顺序与原顺序相同。即若a、b在源字符串中时a在前面,那么在新的字串中时,a也的在b的前面。
回想问题Distinct
Subsequences,其形式表示为 S --通过合理的规则----得到...
分类:
其他好文 时间:
2014-05-24 18:14:24
阅读次数:
284
问题:给定两个字符串S,T,对于S,可以删除其中的任意多个(包括0)字符,使其得到T。问有多少种删法可以得到T。
举例分析:
S:ababa
T: aba
dp[i][j] : 表示 S 从0 ~ i - 1,T从0~j - 1,所得到的方法数。i,j 表示长度。
初始条件:dp[i][0] = 1,T为空串,而空串总是任意串的字串。即,将S串的所有字符都删掉,就得到T。
状态转移...
分类:
其他好文 时间:
2014-05-23 00:54:13
阅读次数:
247
1、
??
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 str...
分类:
其他好文 时间:
2014-05-14 20:22:58
阅读次数:
275
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...
分类:
其他好文 时间:
2014-05-12 09:37:51
阅读次数:
287
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-05-10 19:10:58
阅读次数:
389
题目:
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 (c...
分类:
其他好文 时间:
2014-05-03 21:48:19
阅读次数:
252