随笔分类 -  算法基础—单调栈

摘要:Problem Description Given a matrix of n rows and m columns,find the largest area submatrix which is non decreasing on each column Input The first line 阅读全文
posted @ 2021-07-20 18:29 脂环 阅读(164) 评论(2) 推荐(0) 编辑
摘要:给定一个循环数组(最后一个元素的下一个元素是数组的第一个元素),输出每个元素的下一个更大元素。数字 x 的下一个更大的元素是按数组遍历顺序,这个数字之后的第一个比它更大的数,这意味着你应该循环地搜索它的下一个更大的数。如果不存在,则输出 -1。 示例 1: 输入: [1,2,1] 输出: [2,-1 阅读全文
posted @ 2021-03-06 08:31 脂环 阅读(70) 评论(0) 推荐(0) 编辑
摘要:A. Dense Array 数据范围很小可以直接枚举,对于每个间隔用while循环二倍二倍往里插。 #include <iostream> using namespace std; int a[55]; int main() { freopen("data.txt", "r", stdin); i 阅读全文
posted @ 2021-02-18 11:05 脂环 阅读(143) 评论(0) 推荐(0) 编辑
摘要:This is a harder version of the problem. In this version n≤500000n≤500000 The outskirts of the capital are being actively built up in Berland. The com 阅读全文
posted @ 2020-02-25 16:19 脂环 阅读(314) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
主题色彩