【题目】 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: 【思路】 【代码】 ...
分类:
其他好文 时间:
2018-11-13 02:45:22
阅读次数:
180
Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algor ...
分类:
其他好文 时间:
2018-11-06 20:56:00
阅读次数:
145
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: Input: [ ["1","0","1","... ...
分类:
其他好文 时间:
2018-11-06 13:25:38
阅读次数:
170
In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as ...
分类:
其他好文 时间:
2018-11-05 16:24:21
阅读次数:
152
题目链接:http://poj.org/problem?id=2559 题意: 给出 $n(1 \le n \le 10^5)$ 个宽为 $1$,高为 $h_i(0 \le h_i \le 10^9)$ 的矩形,它们从原点开始并排在 $x$ 轴上, 现在要求出,这个合并产生的图形内部最大的矩形的面积 ...
分类:
其他好文 时间:
2018-11-04 21:23:17
阅读次数:
151
题意大概就是,给定一个包含非负整数的序列nums以及一个整数m,要求把序列nums分成m份,并且要让这m个子序列各自的和的最大值最小(minimize the largest sum among these m subarrays)。 Note:If n is the length of array ...
分类:
其他好文 时间:
2018-11-03 12:43:01
阅读次数:
170
Given a list of non negative integers, arrange them such that they form the largest number. Example 1: Input: [10,2] Output: "210" Example 2: Input: [ ...
分类:
其他好文 时间:
2018-10-30 10:20:13
阅读次数:
155
【23】 Merge k Sorted Lists 【215】 Kth Largest Element in an Array (无序数组中最小/大的K个数) 给了一个无序数组,可能有重复数字,找到第 k 个最大的元素并且返回这个元素值。 题解:直接用直接用个堆保存数组中最大的 K 个数。时间复杂度 ...
分类:
其他好文 时间:
2018-10-30 00:26:09
阅读次数:
207
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist ...
分类:
其他好文 时间:
2018-10-25 14:18:47
阅读次数:
165
给你一个二分图 问你最大团为多大 解一:状压DP 解二:二分图最大匹配 二分图的最大团=补图的最大独立集 二分图最大独立集=二分图定点个数-最大匹配 //Hungary #include<bits/stdc++.h> using namespace std; #define N 50 int use ...
分类:
其他好文 时间:
2018-10-20 23:50:28
阅读次数:
360