[leetcode]Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring....
分类:
其他好文 时间:
2014-10-02 13:30:42
阅读次数:
217
首先呢 可能会想到用一个windows去放这些东西.可能会想到hashtable去. 但是hashtable 无法用Index去查询.abcabcbb. hashtable: abc 当第二个a来的时候, 我们想bca 貌似不好实现.这种情况就很像LRU. 用 node连接,用hashta...
分类:
其他好文 时间:
2014-10-02 04:12:22
阅读次数:
154
Given a string S,
find the longest palindromic substring in S.
You may assume that the maximum length of S is
1000, and there exists one unique longest palindromic substring.
面DP题的考官都是神经病。。(吐...
分类:
其他好文 时间:
2014-10-01 13:15:31
阅读次数:
242
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2014-10-01 09:59:00
阅读次数:
245
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
编程语言 时间:
2014-10-01 02:49:20
阅读次数:
232
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, 2, 3...
分类:
其他好文 时间:
2014-09-30 21:48:20
阅读次数:
179
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...
分类:
其他好文 时间:
2014-09-30 17:19:19
阅读次数:
173
Data StructureAdvantagesDisadvantagesArrayQuick insertion, very fast access if index knownSlow search, slow deletion, fixed size.Ordered arrayQuicker ...
分类:
其他好文 时间:
2014-09-29 13:26:30
阅读次数:
271
Language:Longest Ordered SubsequenceTime Limit:2000MSMemory Limit:65536KTotal Submissions:33812Accepted:14809DescriptionA numeric sequence ofaiis orde...
分类:
其他好文 时间:
2014-09-28 16:04:53
阅读次数:
138
题目大意:
题目给出了定义的小于号,然后求出一个LIS。。。
思路分析:
这道题目的是一个严格递增的,和 Hdu 4742 类似。只不过Hdu的这道题是一个不递减的序列。
简单说一下Hdu 4742的做法。
首先我们可以想到的是一维的LIS,那么简单就是n。
然后二维的LIS,就是先排序一维,然后用求第二维的LIS。
现在问题扩展到三维。依然排序一维。
假设我们排序的是z。...
分类:
其他好文 时间:
2014-09-26 23:22:48
阅读次数:
258