Mondriaan's DreamTime Limit:3000MSMemory Limit:65536KTotal Submissions:12111Accepted:7058DescriptionSquares and rectangles fascinated the famous Dutch...
分类:
其他好文 时间:
2014-11-15 16:58:53
阅读次数:
158
题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2056题意 : 给你两个矩形,的两个点,每个矩形的两个点是这个矩形的对角线的两个点。把一个矩形的对角线的两个点经过如下变换即可化两点为左下,和右上的两个点。以便于解题。n1=min(x1,x2); m1.....
分类:
其他好文 时间:
2014-11-09 15:05:18
阅读次数:
214
Problem Description
Given an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entries are all 1, and we define the maximum area of such rectangle as this ...
分类:
移动开发 时间:
2014-10-17 23:26:50
阅读次数:
264
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
Problem Description
We use Red, Green and Blue to make new colours. See the picture below:
Now give you n rectangles, the colour of them is red or green or blue. You have calculate the area ...
分类:
其他好文 时间:
2014-09-25 10:46:38
阅读次数:
211
UVA 11930 - Rectangles
题目链接
题意:给定一些矩形,每个在两条对角线选一条,保证全部不相交,问可不可行(这题有坑啊,矩形不一定平行坐标轴。。。)
思路:2-sat,主对角线为true,副对角线为false,枚举两个矩形的每条对角线,利用叉积判相交,如果相交就加一条边进去,最后2-sat判定即可
代码:
#include
#include
#...
分类:
其他好文 时间:
2014-09-02 12:30:34
阅读次数:
237
题目大意:
给出一个由0,1构成的矩阵,询问(a,b)到(c,d)两个点之间的只含有0的矩形有多少个。
方法:
由于矩阵不大,最多40*40,而且询问量很大(10^5)由此我们考虑o(1)输出答案,首先用一个四维数组预处理出答案,最后直接输出即可。
令dp[a][b][c][d]为(a,b)到(c,d)两个点之间的只含有0的矩形的数量,
则递推的公式:
dp[a][b...
分类:
其他好文 时间:
2014-08-24 16:47:42
阅读次数:
277
题意,给出一个n行m列的矩阵
里面元素是0或者1
给出q个询问
a,b,c,d
求(a,b)到(c,d)有多少个由0组成的矩形
我们定义
即为求(a,b)到(c,d)有多少个由0组成的矩形
对一个矩形来说
dp[a][b][c][d]=dp[a][b][c][d-1]+dp[a][b][c-1][d]-dp[a][b][c-1][d-1]+包含右下角(当前点)的矩形;
重...
分类:
其他好文 时间:
2014-08-24 15:29:52
阅读次数:
203
~~~~
题意: 给你一个R*C的图,求其由图中连通‘#“所组成的矩形的个数。
注意:If the ships
were placed correctly (i.e., there are only rectangles that do not touch each other even with a corner), print the sentence "There are S shi...
分类:
其他好文 时间:
2014-08-13 01:16:24
阅读次数:
242