(Version 0.0)Decode Ways这道题从原理上说是一个比较简单的一维DP题目,用一个一维数组的元素dp[i] (i >= 1)来记录从头开始长度为i的substring有多少种decode ways。不过实际操作起来第一次写还是在输入为"0"时犯了错误,另外第一次写的时候没有意识到当...
分类:
其他好文 时间:
2015-03-10 11:44:39
阅读次数:
149
新blog地址:http://hengyunabc.github.io/prevent-iframe-stealing/缘起在看资料时,看到这样的防止iframe嵌套的代码:try {
if (window.top != window.self) {
var ref = document.referer;
if (ref.substring(0, 2) ===...
分类:
其他好文 时间:
2015-03-09 20:59:55
阅读次数:
159
题意:给你一个括号序列,问你匹配的最长字串长度和个数。解题思路:栈模拟+ 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
Substring
Given
a set of pattern strings, and a text, you have to find, if any of the pattern is a substring of the text. If any of the pattern string can be found in text, then print “yes”, othe...
分类:
其他好文 时间:
2015-03-08 15:45:57
阅读次数:
225
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
[LeetCode] 030. Substring with Concatenation of All Words (Hard) (C++/Java)...
分类:
编程语言 时间:
2015-03-06 23:41:10
阅读次数:
404