最长公共子序列(longest common subsequence)二维dp 状态dp[i][j]表示字符串x的前缀xi和字符串y的前缀yj能够构成的最长公共子序列的长度。 初始化:第0行和第0列的dp[i][0] 和 dp[0][j]都设为0. 递推:dp[i][j]=dp[i-1][j-...
分类:
其他好文 时间:
2014-09-06 10:57:13
阅读次数:
222
SELECT [DISTINCT|ALL]SELECT_LISTFROM TABLE_LIST[WHERE+CLAUSE][GROUP_BY_CLAUSE][HAVING CONDITION][ORDER_BY_CLAUSE]使用别名代替数据库中的字段名(AS可去除用空格,但不利于阅读)SELECT...
分类:
数据库 时间:
2014-09-05 23:33:42
阅读次数:
261
开发过程中碰到一个关于mysql 全文检索的问题,控制台打印的SQL语句拿到数据库里执行,结果不对。后来发现原来是少了双引号。下面是网上找到的资料,我是看到这个才意识到自己的问题。这是之前在数据库执行的SQL语句,检索结果上万条。SELECT DISTINCT c.Rm_Code, c....
分类:
数据库 时间:
2014-09-05 12:40:21
阅读次数:
223
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping ...
分类:
其他好文 时间:
2014-09-04 13:08:20
阅读次数:
185
问题描述:
给定一个整数序列, 序列中可能有负数。 目的是找出这个序列的连续子序列(即子序列的元素的选取是连续的从序列中选取的)。即通过确定i,
j 的值, 使得的值达到最大。 我们定义, 当所有的元素为负数值的时候, 那么maximum subsequence sum
为0。
下面我们用动态规划的技术去求解。
为了找到最大连续子序列和, 不难看出, 在扩展我们的求和窗口...
分类:
其他好文 时间:
2014-09-02 16:00:14
阅读次数:
187
poj 2533 & poj 1631 Longest Ordered Subsequence( LIS果题 )...
分类:
其他好文 时间:
2014-09-02 09:05:44
阅读次数:
232
代码如下: 1 public static int F=0,L=0; 2 3 static void Main(string[] args) 4 { 5 int first = 0;//当前取最大值时,对应的第一个数 6 ...
分类:
其他好文 时间:
2014-09-01 15:25:13
阅读次数:
227
LeetCode: SubsetsGiven a set of distinct integers, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The soluti...
分类:
其他好文 时间:
2014-08-31 22:53:32
阅读次数:
250
You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb...
分类:
其他好文 时间:
2014-08-31 14:22:31
阅读次数:
219