Longest Ordered Subsequence Longest Ordered Subsequence Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 31680 Accepted: 13848 Description A ...
分类:
其他好文 时间:
2019-05-09 22:17:43
阅读次数:
156
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Example 2: Idea 1. Dynamic pr ...
分类:
其他好文 时间:
2019-05-09 10:46:05
阅读次数:
99
案例一:Leetcode 28.实现 strStr() 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回 -1。 示例 1: 输入: haystack = "hello", ne ...
分类:
其他好文 时间:
2019-05-03 14:44:59
阅读次数:
114
Given n integers. You have two operations: U A B: replace the Ath number by B. (index counting from 0) Q A B: output the length of the longest consecu ...
分类:
其他好文 时间:
2019-05-03 11:27:10
阅读次数:
185
A sequence X_1, X_2, ..., X_n is fibonacci-like if: n >= 3 X_i + X_{i+1} = X_{i+2} for all i + 2 <= n Given a strictly increasing array A of positive ...
分类:
其他好文 时间:
2019-05-03 09:23:55
阅读次数:
97
1. 原始题目 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 示例 2: 示例 3: 2. 思路 双指针法。[i,j]左闭又闭区间为当前子串,如果j+1位置的元素没有重复则继续加入,否则i+1直到没有重复元素。那么如何确定是否重复呢,有两种方法,第一种是循环判断在字串 ...
分类:
其他好文 时间:
2019-05-02 11:48:01
阅读次数:
117
大意: 给定序列$a$, 求选出最长的一个子序列, 使得lcm不超过m. 刚开始想复杂了, 想着枚举gcd然后背包, 这样复杂度就是$O(\sum\limits_{i=1}^m \frac{m\sigma_0(i)}{i})$...... 估计了一下1e6大概只有1e8, 感觉剪个枝应该就可以过了, ...
分类:
其他好文 时间:
2019-05-01 18:41:00
阅读次数:
108
Greenhouse Effect CodeForces - 269B Emuskald is an avid horticulturist and owns the world's longest greenhouse — it is effectively infinite in length. ...
分类:
其他好文 时间:
2019-05-01 01:24:19
阅读次数:
90
开始觉得挺简单的 写完发现这个时间超限了: 用pycharm跑了下 要4秒,结果就是它自己。[testcase:85] 发现之前判断轴对称的方法太低级了 不用逐位判断 轴对称的前一半和后一半的逆序是同一字符串即可。 testcase:95 f比g多一个 ...
分类:
其他好文 时间:
2019-04-27 09:39:30
阅读次数:
133
https://leetcode.com/problems/longest common prefix/ ...
分类:
其他好文 时间:
2019-04-26 14:57:10
阅读次数:
120