Toggle navigation
点码成金编程
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Home
=>
ProblemSet
=> 3.3-19:最大矩形面积
Problem1989--3.3-19:最大矩形面积
1989: 3.3-19:最大矩形面积
Time Limit:
1
Sec
Memory Limit:
128 MB
Submit:
0
Solved:
0
[
Submit
] [
Status
] [ Creator:
][ 参考程序 ]
Description
给出一张柱状图,每根柱子的宽度为1,高度为h
i
,现在请你求出柱状图中最大矩形的面积。
Input
第一行一个正整数n,表示柱子的个数 (n<=10
5
)
第二行n个非负整数,h
i
表示第 i 个柱子的高度 (h
i
<= 10
9
)
Output
最大矩形面积
Sample Input
Copy
11 5 3 4 2 6 5 0 7 3 4 4
Sample Output
Copy
12
HINT
n <= 10
5
h
i
<= 10
9
Source/Category
数据结构
栈