码迷,mamicode.com
首页 >  
搜索关键字:csu 1547 rectangle    ( 2022个结果
codeforces535C:Tavas and Karafs(二分)
Karafs is some kind of vegetable in shape of an 1?×?h rectangle. Tavaspolis people love Karafs and they use Karafs in almost any kind of food. Tavas, himself, is crazy about Karafs. Each Karafs...
分类:其他好文   时间:2015-04-16 23:46:24    阅读次数:211
POJ 2559 Largest Rectangle in a Histogram (DP最大矩形面积)
给定从左到右多个矩形,已知这此矩形的宽度都为1,长度不完全相等。这些矩形相连排成一排,求在这些矩形包括的范围内能得到的面积最大的矩形,打印出该面积。所求矩形可以横跨多个矩形,但不能超出原有矩形所确定的范围。l[i]表示大于等于h[i]的最左边的位置,r[i]表示大于等于h[i]的最右边的位置,这样可以预处理出l[],r[],然后ans = max(ans, r[i] - l[i] + 1) * h[...
分类:其他好文   时间:2015-04-16 21:59:32    阅读次数:187
csuOJ啊 1553
题目地址:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1553#include #include #include using namespace std;int main(){ long long int a[10005],n,k; ...
分类:其他好文   时间:2015-04-16 21:36:35    阅读次数:99
CSU 1364 Interview ST
先用ST预处理一下,做到可以O(1)得到[l,r]最值 然后枚举块的长度,在枚举每个块,这样的复杂度就是n/1+n/2+n/3+...+n/n n有20W,这个前面这个式子的值差不多又240W,复杂度可以接受。。 另外一开始想到一个做法,二分答案,但是经证实这样的的确确是错的 1 #i...
分类:其他好文   时间:2015-04-15 00:52:08    阅读次数:138
Rectangle(csu)
DescriptionNow ,there are some rectangles. The area of these rectangles is 1* x or 2 * x ,and now you need find a big enough rectangle( 2 * m) so that...
分类:其他好文   时间:2015-04-14 23:10:48    阅读次数:143
leetcode || 84、Largest Rectangle in Histogram
problem: 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 histogram. Above is a histo...
分类:其他好文   时间:2015-04-14 16:45:49    阅读次数:88
leetcode || 85、Maximal Rectangle
problem: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. Hide Tags  Array Hash Table Stack Dynamic Programmin...
分类:其他好文   时间:2015-04-14 16:40:04    阅读次数:110
Inversion Sequence(csu 1555)
DescriptionFor sequence i1, i2, i3, … , iN, we set aj to be the number of members in the sequence which are prior to j and greater to j at the same ti...
分类:其他好文   时间:2015-04-13 20:49:57    阅读次数:108
[LeetCode 85] Maximal Rectangle (华为2015机试)
题目链接:maximal-rectangle import java.util.Arrays; /** * Given a 2D binary matrix filled with 0's and 1's, * find the largest rectangle containing all ones and return its area. * */ public cl...
分类:其他好文   时间:2015-04-12 13:28:40    阅读次数:189
LeetCode Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. 题意:求0,1矩阵中,1构成的最大矩阵。 思路:借用了上一题,首先我们先计算出dp[i][j]表示到第i行第j列时,此时这一列的连续1的个数,然后计算每一行...
分类:其他好文   时间:2015-04-12 10:37:34    阅读次数:118
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!