
单调栈
Cruiying
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
The Preliminary Contest for ICPC China Nanchang National Invitational I题 Max answer
Alice has a magic array. She suggests that the value of a interval is equal to the sum of the values in the interval, multiplied by the smallest value in the interval. Now she is planning to find the ...原创 2019-04-21 23:44:54 · 118 阅读 · 0 评论 -
牛客小白月赛13 H题
链接:https://ac.nowcoder.com/acm/contest/549/H 来源:牛客网 柱状图是有一些宽度相等的矩形下端对齐以后横向排列的图形,但是小A的柱状图却不是一个规范的柱状图,它的每个矩形下端的宽度可以是不相同的一些整数,分别为a[i]每个矩形的高度是h[i],现在小A只想知道,在这个图形里面包含的最大矩形面积是多少。 单调栈的模板题,考虑每个位置向两边拓展的最左边的边界和...原创 2019-04-17 15:32:41 · 195 阅读 · 0 评论 -
CF547B Mike and Feet
Mike is the president of country What-The-Fatherland. There are n n bears living in this country besides Mike. All of them are standing in a line and they are numbered from 1 1 to n n from left to rig...原创 2019-04-22 21:23:27 · 312 阅读 · 0 评论 -
1215 数组的宽度 单调栈
N个整数组成的数组,定义子数组a[i]…a[j]的宽度为:max(a[i]…a[j]) - min(a[i]…a[j]),求所有子数组的宽度和。 输入 第1行:1个数N,表示数组的长度。(1 <= N <= 50000) 第2 - N + 1行:每行1个数,表示数组中的元素(1 <= A[i] <= 50000) 输出 输出所有子数组的宽度和。 输入样例 5 1 2 3 4...原创 2019-12-07 08:48:46 · 121 阅读 · 0 评论