码迷,mamicode.com
首页 >  
搜索关键字:longest consecutive    ( 3017个结果)
[string]Longest Palindromic Substring
Total Accepted:82026Total Submissions:379898Difficulty:MediumGiven a stringS, find the longest palindromic substring inS. You may assume that the maxi...
分类:其他好文   时间:2015-12-07 22:48:22    阅读次数:294
[string]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 fo...
分类:其他好文   时间:2015-12-07 20:30:10    阅读次数:183
[LeetCode] Longest Valid Parentheses 解题思路
可以借助 stack 一次遍历就将全部有效括号替换为 '.'。 第一步:一次遍历,stack 只存放 '(' 的下标。     当找到一个 '(',则压进 stack ;     当找到一个 ')',则把 stack.top 对于的字符替换为 '.',并弹出 stack.pop()。耗时O(n...
分类:其他好文   时间:2015-12-06 17:47:28    阅读次数:139
1096. Consecutive Factors (20)
n和i要用long long要不然乘着乘着就是负的了时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueAmong all the factors of a positive integer N, there may exist sev...
分类:其他好文   时间:2015-12-06 12:54:37    阅读次数:123
求最长回文串
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-12-03 21:24:33    阅读次数:220
SPOJ - LIS2 Another Longest Increasing Subsequence Problem
cdq分治,dp(i)表示以i为结尾的最长LIS,那么dp的递推是依赖于左边的。因此在分治的时候需要利用左边的子问题来递推右边。(345ms? 区间树TLE/********************************************************** -...
分类:其他好文   时间:2015-12-02 09:09:20    阅读次数:492
LintCode: Longest Common Substring
C++暴力搜索两个游标一个长度i遍历aj遍历blen遍历公共子串长度 1 class Solution { 2 public: 3 /** 4 * @param A, B: Two string. 5 * @return: the length of the lo...
分类:其他好文   时间:2015-12-01 14:28:03    阅读次数:168
[LeetCode]Longest Increasing Subsequence
public class Solution { public int lengthOfLIS(int[] nums) { int length = nums.length; List record = new ArrayList(); for (int...
分类:其他好文   时间:2015-12-01 09:41:45    阅读次数:168
[lintcode easy]Longest Increasing Continuous subsequence
Longest Increasing Continuous subsequenceGive you an integer array (index from 0 to n-1, where n is the size of this array),find the longest increasin...
分类:其他好文   时间:2015-12-01 07:08:54    阅读次数:140
LintCode: Longest Increasing Continuous subsequence
C++双向递推空间O(1)时间O(n) 1 class Solution { 2 public: 3 /** 4 * @param A an array of Integer 5 * @return an integer 6 */ 7 int long...
分类:其他好文   时间:2015-11-30 13:13:50    阅读次数:135
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!