p.s. 单调栈应用
完美矩阵
Time Limit: 1000 ms Memory Limit: 65536 KiB
Problem Description
给你n个连续的宽为1的长方形,高为a[i]。
完美矩形指的就是:所给图形里面包含最大面积的矩形。
输出完美矩形的面积。
Input
第一行给你一个正整数 n(1<=n<=1e5),第二行给你 n 个正整数 a[i](1<=a[i]<=1e9),分别代表第 i 个长方形的高度。
Output
输出完美矩形的面积
Sample Input
7
2 1 4 5 1 3 3
Sample Output
8
题目链接:
http://acm.sdut.edu.cn/onlinejudge2/index.php/Home/Contest/contestproblem/cid/2736/pid/4357
#include <bits/stdc++.h>
using namespace std;
int main()
{