Largest Rectangle in a Histogram (poj 2559 hdu 1506 矩形系列

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 rectangles with the heights 2, 1, 4, 5, 1, 3, 3, measured in units where 1 is the width of the rectangles:

Usually, histograms are used to represent discrete distributions, e.g., the frequencies of characters in texts. Note that the order of the rectangles, i.e., their heights, is important. Calculate the area of the largest rectangle in a histogram that is aligned at the common base line, too. The figure on the right shows the largest aligned rectangle for the depicted histogram.

,不必在乎目的地,在乎的是沿途的风景以及看风景的心情,让心灵去旅行!

Largest Rectangle in a Histogram (poj 2559 hdu 1506 矩形系列

相关文章:

你感兴趣的文章:

标签云: