SP1805 Largest Rectangle in a Histogram】的更多相关文章

题目链接: 洛谷SP1805 题意: 如图所示,在一条水平线上有n个宽为1的矩形,求包含于这些矩形的最大子矩形面积(图中的阴影部分的面积即所求答案) 输入格式: 有多组测试数据,每组数据占一行.输入零时读入结束. 每行开头为一个数字n(1<=n<=100000),接下来在同一行给出n个数字h1h2...hn(0<=hi<=1000000000)表示每个矩形的高度. 输出格式: 对于每组数据,输出最大子矩阵面积,一组数据输出一行. 题目分析: 一道单调栈的典型例题-- 如果矩形高度单…
[题解]Largest Rectangle in a Histogram [SP1805] [POJ2559] [题目描述] 传送: \(Largest\) \(Rectangle\) \(in\) \(a\) \(Histogram\) \([SP1805]\) \([POJ2559]\) 同一水平线上有 \(n\) 个矩形,构成了一个柱状多边形,矩形宽度均为 \(1\),高度不同.如图: 你需要在多边形中框选出一个矩形,使其面积最大,如图阴影部分. [输入] 每组数据包含一个整数 \(n\)…
Largest Rectangle in a Histogram Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19782   Accepted: 6393 Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal wi…
Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rectang…
Largest Rectangle in a Histogram Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 16   Accepted Submission(s) : 6 Problem Description A histogram is a polygon composed of a sequence of rectangles…
传送门 Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows the histogram that consists of rec…
Largest Rectangle in a Histogram HDU1506 一道DP题: 思路:http://blog.csdn.net/qiqijianglu/article/details/8556852 #include <stdio.h> #include <iostream> using namespace std; ]; ],r[]; int main() { int n,i,j; long long maxx,sum; while(~scanf("%d…
Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18942   Accepted: 6083 Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heigh…
2107: Largest Rectangle in a Histogram Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 777  Solved: 220 Description A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may ha…
E - Largest Rectangle in a Histogram Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1506 Appoint description: Description A histogram is a polygon composed of a sequence of rectangles aligned a…