题目地址:https://leetcode.com/problems/longest-valid-parentheses/Given a string containing just the characters ‘(’ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
For “(...
分类:
其他好文 时间:
2015-03-14 16:55:18
阅读次数:
188
求树的最长链,BFS和DFS都可以,时间复杂度O(n)#include#includeint tot,vt[20005],nxt[20005],a[20005];bool vis[10005];int n,i,j,xx,yy,s,ma,r;void search(int x,int dep){ .....
分类:
其他好文 时间:
2015-03-14 10:58:28
阅读次数:
207
[LeetCode] 032. Longest Valid Parentheses (Hard) (C++)...
分类:
编程语言 时间:
2015-03-13 16:35:05
阅读次数:
170
LeetCode_Longest Consecutive Sequence...
分类:
其他好文 时间:
2015-03-13 07:09:33
阅读次数:
172
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 le...
分类:
其他好文 时间:
2015-03-13 00:14:25
阅读次数:
141
题目要求: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 lon...
分类:
其他好文 时间:
2015-03-11 23:17:44
阅读次数:
155
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-03-11 21:29:40
阅读次数:
112
Longest Consecutive Sequence问题:Given an unsorted array of integers, find the length of the longest consecutive elements sequence.思路: HashSet进行存储我的代码:....
分类:
其他好文 时间:
2015-03-11 21:23:53
阅读次数:
110
uva 10405 Longest Common SubsequenceSequence 1:Sequence 2:Given two sequences of characters, print the length of the longest common subsequence of both sequences. For example, the longest common subseq...
分类:
其他好文 时间:
2015-03-11 00:47:35
阅读次数:
140
LeetCode(4) || Longest Palindromic Substring 与 Manacher 线性算法题记本文是LeetCode题库的第五题,没想到做这些题的速度会这么慢,工作之余全部耗在这上面了,只怪自己基础差。本文主要介绍使用Manacher线性算法来求解字符串的最长回文子字符...
分类:
编程语言 时间:
2015-03-10 23:02:35
阅读次数:
203