码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果)
poj 2533 Longest Ordered Subsequence 最长递增子序列(LIS)
两种算法1. O(n^2) 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int a[1005]; 7 int dp[1005]; 8 int main() 9 {10 int n, maxn;11 whil...
分类:其他好文   时间:2015-12-20 13:09:32    阅读次数:194
leetcode Longest Valid Parentheses python
class Solution(object): def longestValidParentheses(self, s): """ :type s: str :rtype: int """ maxlen=0 s...
分类:编程语言   时间:2015-12-16 00:23:48    阅读次数:221
300. Longest Increasing Subsequence
题目:Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given[10, 9, 2, 5, 3, 7, 101, 18],The longest in...
分类:其他好文   时间:2015-12-15 14:07:26    阅读次数:201
LeetCode - Longest Common Prefix
题目:Write a function to find the longest common prefix string amongst an array of strings.思路:以第一个字符串为基准,然后循环比较package string;public class LongestCommon...
分类:其他好文   时间:2015-12-15 14:04:40    阅读次数:115
298. Binary Tree Longest Consecutive Sequence
题目:Given a binary tree, find the length of the longest consecutive sequence path.The path refers to any sequence of nodes from some starting node to a...
分类:其他好文   时间:2015-12-15 07:45:15    阅读次数:175
算法入门经典大赛 Dynamic Programming
111 - History Grading LCS103 - Stacking Boxes 最多能叠多少个box DAG最长路10405 - Longest Common Subsequence LCS674 - Coin Change 全然背包求方案数10003- Cutting Sticks 区...
分类:编程语言   时间:2015-12-10 10:56:51    阅读次数:208
LeetCode - Longest Palindromic Substring
题目: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 lon...
分类:其他好文   时间:2015-12-09 17:18:01    阅读次数:115
Maximum Depth of Binary Tree
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-12-09 17:06:30    阅读次数:108
LeetCode - Longest Substring Without Repeating Characters
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
分类:其他好文   时间:2015-12-08 15:53:31    阅读次数:151
poj 2739(筛法求素数)
Sum of Consecutive Prime NumbersTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 21613Accepted: 11837DescriptionSome positive integers can b.....
分类:其他好文   时间:2015-12-08 09:57:00    阅读次数:150
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!