https://leetcode.com/problems/edit-distance/Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each oper...
分类:
其他好文 时间:
2015-12-06 19:24:36
阅读次数:
200
题目和南阳那道题一样链接http://www.cnblogs.com/zzuli2sjy/p/4943774.html代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 typedef long long l...
分类:
编程语言 时间:
2015-11-19 13:13:04
阅读次数:
204
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-10-30 07:08:16
阅读次数:
217
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...
分类:
其他好文 时间:
2015-09-22 01:28:15
阅读次数:
189
Distinct SubsequencesGiven a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is...
分类:
其他好文 时间:
2015-09-12 12:15:57
阅读次数:
134
Distinct SubsequencesTotal Accepted:38466Total Submissions:143567My SubmissionsQuestionSolutionGiven a stringSand a stringT, count the number of disti...
分类:
其他好文 时间:
2015-09-09 11:21:48
阅读次数:
214
LeetCode -- Distinct Subsequences...
分类:
其他好文 时间:
2015-08-29 14:02:00
阅读次数:
155
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...
分类:
其他好文 时间:
2015-08-28 17:52:45
阅读次数:
187
题目链接:点击打开链接
题意描述:给定一个序列,找出其中递增子序列的数量?
解题思路:
1、dp[i]:表示以元素i结尾的子序列的数量,则d[j]=sum(d[i])+1;其中(j>=i且j的下标大于i)
2、此刻我们可以联想到树状数组,按数组下标从小到大的顺序插入元素,那么d[j]就等于sum(j)+1;
3、由于数据范围比较大,我们采用离散化处理即可
代码:
#i...
分类:
编程语言 时间:
2015-08-28 15:38:20
阅读次数:
153
DescriptionGiven a string, calculate the number of subsequences that are palindrome. A palindrome is a sequence of characters that reads the same back...
分类:
其他好文 时间:
2015-08-19 00:16:52
阅读次数:
166