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
treap插入、删除、查询时间复杂度均为O(logn)treap树中每个节点有两种权值:键值和该节点优先值如果只看优先值,这棵树又是一个堆treap有两种平衡方法:左旋&右旋insert 插入remove 删除_find 查找kth 返回root为根的树中第k大的元素 1 #include 2...
分类:
其他好文 时间:
2014-10-16 00:52:11
阅读次数:
274
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
Largest Rectangle in Histogram
Total Accepted: 18582 Total
Submissions: 86792My Submissions
Given n non-negative integers representing the histogram's bar height where the width of each b...
分类:
其他好文 时间:
2014-10-14 16:38:09
阅读次数:
154
[leetcode]Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area....
分类:
其他好文 时间:
2014-10-14 13:49:48
阅读次数:
148
Largest prime factor
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7009 Accepted Submission(s): 2482
Problem Description
Every...
分类:
其他好文 时间:
2014-10-13 13:10:47
阅读次数:
207
1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 class Solution { 8 public: 9 int largestRectangleArea(vector &height)...
分类:
其他好文 时间:
2014-10-12 23:59:48
阅读次数:
173