题目链接 : https://leetcode cn.com/problems/largest rectangle in histogram/ 题目描述: 给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1 。 求在该柱状图中,能够勾勒出来的矩形的最大面积。 以上是 ...
分类:
其他好文 时间:
2019-06-07 00:50:13
阅读次数:
93
描述 Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements. G ...
分类:
其他好文 时间:
2019-06-04 09:26:13
阅读次数:
96
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. Example: 题意 给定一个01矩阵,找出其中全由1构成的最 ...
分类:
其他好文 时间:
2019-05-31 16:33:58
阅读次数:
91
题目描述: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Ex ...
分类:
其他好文 时间:
2019-05-31 01:07:55
阅读次数:
119
用堆解 两种实现方法 1)最大堆,o(klogn) 直接将原数组建堆 o(n) 然后弹出k次 (klogn) 返回最后一次poll()的值 2)最小堆 用数组前k个数建堆 o(k) 剩下n-k,依次插入堆中然后推出堆顶元素o((n-k)logk) 剩下的k个肯定是前k大的数,只要返回此时堆顶即可 ...
分类:
其他好文 时间:
2019-05-26 16:07:25
阅读次数:
110
53. Maximum Subarray 1 题目 Given an integer array , find the contiguous subarray (containing at least one number) which has the largest sum and return ...
分类:
其他好文 时间:
2019-05-26 00:30:53
阅读次数:
116
Largest Rectangle in a HistogramTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submissio ...
分类:
其他好文 时间:
2019-05-11 13:33:19
阅读次数:
85
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: 这是一个DP题,好像是线性DP吧。 官方题解有DP的 ...
分类:
其他好文 时间:
2019-05-10 13:09:06
阅读次数:
138
#include<bits/stdc++.h>using namespace std;int n,m,l,t;int a[1307][137][67];int vis[1307][137][67];typedef struct{ int x,y,z;}node;int xx[6]={0,0,0,0, ...
分类:
其他好文 时间:
2019-05-09 23:45:36
阅读次数:
158