![](https://img-blog.csdnimg.cn/20190927151053287.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
算法题 - 单调栈
单调栈、dp
小猪快点跑
这个作者很懒,什么都没留下…
展开
-
单调栈
一、单调栈的一些特点 1、一般作为单调栈的数据结构 vector<>、stack<>、string 2、单调栈特点 (1)特点1 当前元素左侧想要找的东西,需要在该元素进栈时找到; 当前元素右侧想要找的东西,需要在之后元素进栈时获得。 当一个元素进栈时,更新它左侧想要的东西,更新栈内元素右侧想要的东西。 (2)...原创 2019-08-10 12:21:41 · 209 阅读 · 0 评论 -
二维最长上升子序列
1、二维最长上升子序列 —— 相等可嵌套 (1)排序,一维正排序,二维正排序; (2)对第二维度,求 最长 弱上升子序列,upper_bound #include <iostream> #include <vector> #include <algorithm> //sort、max using namespace std; bool ...原创 2019-09-03 21:42:30 · 1467 阅读 · 1 评论