![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LIS
文章平均质量分 61
三更鬼
这个作者很懒,什么都没留下…
展开
-
力扣 334. 递增的三元子序列
LIS 贪心解法改版原创 2022-01-13 09:57:52 · 139 阅读 · 0 评论 -
力扣 1218. 最长定差子序列
题目来源:https://leetcode-cn.com/problems/longest-arithmetic-subsequence-of-given-difference/大致题意:给定一个数组和一个差值 diff,找最长的相邻元素差都为 diff 的子序列的长度思路我寻思这就是 LIS 的微改版本,于是按着 LIS 动态规划的方法走了一遍,结果超时了题解就是 LIS dp的优化版本动态规划在之前的思路中,使用 dp[i] 存下当前位置 i 的最长上升子序列长度,于是在本题,可以使用 d原创 2021-11-05 13:51:10 · 93 阅读 · 0 评论 -
力扣 300. 最长递增子序列 && 673. 最长递增子序列的个数
题目来源:300. 最长递增子序列、673. 最长递增子序列的个数大致题意:前者就是求出最长递增子序列,后者就是求出最长递增子序列有多少种(只求个数)思路因为每日一题是求最长递增子序列的个数,所以就先做了最长上升子序列(LIS)LIS 动态规划使用一维数组 dp[i] 表示从首位元素到第 i 位的 LIS 长度外层从 0 - n-1 遍历,每次先初始化当前 dp[i] 为 1(最小的 LIS 也为1)内层遍历从 0 到 i 位置之前的所有元素,若当前位置 j 元素值小于 i 位置元素且 d原创 2021-09-25 18:04:34 · 122 阅读 · 0 评论 -
Bridging signals||POJ1631
link:http://poj.org/problem?id=1631 Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, makin原创 2017-08-09 16:48:55 · 219 阅读 · 0 评论 -
Bellovin||HDU5748
link:http://acm.hdu.edu.cn/showproblem.php?pid=5748 Problem DescriptionPeter has a sequence a1,a2,...,an and he define a function on the sequence -- F(a1,a2,...,an)=(f1,f2,...,fn), where fi is the len原创 2017-08-09 17:45:45 · 247 阅读 · 0 评论 -
The All-purpose Zero||HDU5773
link:http://acm.hdu.edu.cn/showproblem.php?pid=5773 Problem Description?? gets an sequence S with n intergers(0 < n <= 100000,0<= S[i] <= 1000000).?? has a magic so that he can change 0 to any interge原创 2017-08-09 18:20:14 · 228 阅读 · 0 评论