题目链接:https://nanti.jisuanke.com/t/38232 就是判断输入是不是子序列 没想到贡献了将近十几次罚时..........可以说是菜的真实了 用cin cout超时了 改了scanf printf才过 ...
分类:
其他好文 时间:
2019-04-21 00:10:10
阅读次数:
220
题目链接:http://poj.org/problem?id=2533 Time Limit: 2000MS Memory Limit: 65536K Description A numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let ...
分类:
其他好文 时间:
2019-04-15 16:03:37
阅读次数:
152
Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it ...
分类:
其他好文 时间:
2019-04-06 12:32:36
阅读次数:
98
"CF1142E/1143B Lynyrd Skynyrd" 开始读错题了,以为是连续的一段,敲完后才发现是 $subsequence$ ... 考虑对于 $a$ 中的每个 $a_i$ 找到它在排列 $p$ 中的下一个元素的最左位置 $j$ ,从 $i$ 到 $j$ 连一条边,这样就形成了一个森林. ...
分类:
其他好文 时间:
2019-04-06 09:35:16
阅读次数:
100
本题大意:和LIS一样 本题思路:用dp[ i ]保存前 i 个数中的最长递增序列的长度,则可以得出状态转移方程dp[ i ] = max(dp[ j ] + 1)(j < i) 参考代码: 1 #include <iostream> 2 #include <cstring> 3 #include ...
分类:
其他好文 时间:
2019-04-03 14:06:06
阅读次数:
152
题目要求 Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is ...
分类:
其他好文 时间:
2019-04-01 11:50:44
阅读次数:
137
链接:https://vjudge.net/problem/HDU-1159#author=0 题意: 最长公共子序列,LCS 思路: LCS 代码: ...
分类:
其他好文 时间:
2019-03-31 09:35:45
阅读次数:
156
网址:https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/ 其实就是斐波那契数列,没什么好说的。 注意使用3个变量,而不是数组,可以节约空间。 ...
分类:
其他好文 时间:
2019-03-28 00:32:21
阅读次数:
163
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-03-23 12:58:30
阅读次数:
118
446. Arithmetic Slices II - Subsequence Hard Hard A sequence of numbers is called arithmetic if it consists of at least three elements and if the diff ...
分类:
其他好文 时间:
2019-03-21 01:23:53
阅读次数:
155