题意:给你一个括号序列,问你匹配的最长字串长度和个数。解题思路:栈模拟+ dp解题代码: 1 // File Name: 5c.cpp 2 // Author: darkdream 3 // Created Time: 2015年03月09日 星期一 12时00分57秒 4 5 #include ....
分类:
其他好文 时间:
2015-03-09 14:15:07
阅读次数:
106
Given two strings, find the longest common substring.Return the length of it.NoteThe characters in substring should occur continiously in original str...
分类:
其他好文 时间:
2015-03-09 12:17:48
阅读次数:
105
Given two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.ExampleFor "ABCD" and "EDCA", the LCS is "A" (...
分类:
其他好文 时间:
2015-03-09 09:20:00
阅读次数:
141
参考【1】:longest consecutive subsequence of a random permutation 第一个帖子: Theorem:The expected length of the longest increasing block in a random permu...
分类:
其他好文 时间:
2015-03-09 07:03:48
阅读次数:
206
题目大意:给出一个长字符串,问最长的前缀,使得这个前缀能用给出的一些元素组合而成思路:暴力dp,dp[i]表示长度为i的前缀能否被表示 1 /*{ 2 ID:a4298442 3 PROB:prefix 4 LANG:C++ 5 } 6 */ 7 #include 8 #include 9 #inc...
分类:
其他好文 时间:
2015-03-08 18:41:18
阅读次数:
158
Problem StatementGive two string $s_1$ and $s_2$, find the longest common substring (LCS). E.g: X = [111001], Y = [11011], the longest common substrin...
分类:
其他好文 时间:
2015-03-08 11:38:44
阅读次数:
143
1.题目描述Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.2.解决方案1class Solution {
public:...
分类:
其他好文 时间:
2015-03-06 11:22:23
阅读次数:
126
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For example, the ...
分类:
其他好文 时间:
2015-03-05 16:15:49
阅读次数:
104
Write a function to find the longest common prefix string amongst an array of strings.
这个题目非常简单,只要弄清楚题意就可以非常快地解决,我的C++代码实现如下: string longestCommonPrefix(vector &strs) {
if (strs.empt...
分类:
其他好文 时间:
2015-03-04 19:13:18
阅读次数:
127
HDU 1403 Longest Common Substring(后缀数组啊 求最长公共子串 模板题)...
分类:
编程语言 时间:
2015-03-04 19:08:31
阅读次数:
161