问题描述:给出一个序列a1,a2,a3,a4,a5,a6,a7….an,求它的一个子序列(设为s1,s2,…sn),使得这个子序列满足这样的性质,s1= 0; i--){ 8: int maxTemp = flag[i]; 9: for (int j = i+1; j flag[j] + 1 ...
分类:
编程语言 时间:
2015-11-04 22:43:01
阅读次数:
323
原题链接在这里:https://leetcode.com/problems/longest-increasing-subsequence/是一道DP问题,参考这篇帖子:http://blog.csdn.net/left_la/article/details/119510855,3,4,8,6,7根据...
分类:
其他好文 时间:
2015-11-04 14:24:07
阅读次数:
228
题目:
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
For example,
Given [100, 4, 200, 1, 3, 2],
The longest consecutive elements sequence is [1,...
分类:
其他好文 时间:
2015-11-04 11:32:42
阅读次数:
181
QuestionGiven a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the...
分类:
其他好文 时间:
2015-11-04 09:23:02
阅读次数:
136
QuestionGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique lo...
分类:
其他好文 时间:
2015-11-04 01:56:54
阅读次数:
182
A typical O(n^2) solution uses dynamic programming. Let's use lens[j] to denote the length of the LIS ending with nums[j]. The state equations arelens...
分类:
其他好文 时间:
2015-11-03 23:00:50
阅读次数:
240
题目描述:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", th...
分类:
编程语言 时间:
2015-11-03 22:42:46
阅读次数:
183
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-11-02 00:00:09
阅读次数:
277
题目链接:https://leetcode.com/problems/longest-palindromic-substring/输出最长的回文串 1 class Solution { 2 public: 3 int pre[22222]; 4 char x[22222]; 5 ...
分类:
其他好文 时间:
2015-10-31 17:14:56
阅读次数:
182
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2015-10-31 14:19:03
阅读次数:
109