[leetcode]Largest Rectangle in Histogram...
分类:
其他好文 时间:
2014-10-20 11:55:19
阅读次数:
156
HP Arcsight Imperva is a HP Business Partner. HP is the world's largest IT co...
分类:
其他好文 时间:
2014-10-20 09:50:51
阅读次数:
460
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4...
分类:
其他好文 时间:
2014-10-20 08:38:54
阅读次数:
125
Leetcode 加新题了Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array ...
分类:
其他好文 时间:
2014-10-19 15:36:04
阅读次数:
251
题目大意:给你一个直方图,告诉你各个条形矩形的高度,求基线对齐构成的矩形中面积
最大的矩形的面积对于每一个矩形。面积 = h[i]*(j-k+1),其中j,k是左右边界,h[i]是矩形
的高。并且对于j <= x <= k,h[i] <= h[x]。
本题中,找到左右边界j,k是关键。
利用动态规划的方法,对于位置i,如果左边条形矩形的高度大于它本身,那么左边的左边
界一定也满足位置i的左边界。同理如果右边条形矩形的高度大于它本身,那么右边的右边
界也一定满足位置i的右边界。迭代循环下去。直到找到i的左右边...
分类:
其他好文 时间:
2014-10-18 11:16:38
阅读次数:
173
Problem 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 figu...
分类:
其他好文 时间:
2014-10-17 23:26:46
阅读次数:
426
Add Date2014-09-23Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product....
分类:
编程语言 时间:
2014-10-17 00:33:53
阅读次数:
316
先搞定这题。ZOJ1985 Largest Rectangle in a Histogram再做这题。先枚举第二个矩形对第一个矩形的偏移量(x,y),再进行2维DP,复杂度为O(n^2 *n^2),即O(n^4).#include using namespace std;const int maxn...
分类:
其他好文 时间:
2014-10-17 00:07:53
阅读次数:
405
1.题目Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4]...
分类:
编程语言 时间:
2014-10-15 19:29:41
阅读次数:
228
Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t...
分类:
其他好文 时间:
2014-10-15 12:52:20
阅读次数:
160