码迷,mamicode.com
首页 >  
搜索关键字:kth largest    ( 1961个结果
HDU 1056 Largest Rectangle in a Histogram(dp)(求最大的矩形面积)
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
【LeetCode】Maximum Product Subarray 求连续子数组使其乘积最大
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
zoj 3367 Counterfeit Money(dp)
先搞定这题。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实现山寨set
treap插入、删除、查询时间复杂度均为O(logn)treap树中每个节点有两种权值:键值和该节点优先值如果只看优先值,这棵树又是一个堆treap有两种平衡方法:左旋&右旋insert 插入remove 删除_find 查找kth 返回root为根的树中第k大的元素 1 #include 2...
分类:其他好文   时间:2014-10-16 00:52:11    阅读次数:274
1014------算法笔记----------Maximum Product Subarray 最大乘积子数组
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
Maximum Product Subarray
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
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
Maximal Rectangle
[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
hdu 2136 (Largest prime factor)就是简单 的筛选素数法
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
leetcode-Largest Rectangle in Histogram
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!