poj 2836 Rectangular Covering】的更多相关文章

Rectangular Covering Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2776   Accepted: 790 Description n points are given on the Cartesian plane. Now you have to use some rectangles whose sides are parallel to the axes to cover them. Ever…
[题目链接] http://poj.org/problem?id=2836 [题目大意] 给出二维平面的一些点,现在用一些非零矩阵把它们都包起来, 要求这些矩阵的面积和最小,求这个面积和 [题解] 我们计算出以每两个点为矩形顶点所构成的矩形面积和包含的点子集, 然后对这些子集进行状态DP,求全集的最小覆盖 [代码] #include <cstdio> #include <algorithm> #include <vector> #include <cstring&…
Description n points are given on the Cartesian plane. Now you have to use some rectangles whose sides are parallel to the axes to cover them. Every point must be covered. And a point can be covered by several rectangles. Each rectangle should cover…
题意:平面上有 n (2 ≤ n ≤ 15) 个点,现用平行于坐标轴的矩形去覆盖所有点,每个矩形至少盖两个点,矩形面积不可为0,求这些矩形的最小面积. 析:先预处理所有的矩形,然后dp[s] 表示 状态 s 时,最少需要的面积是多少. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstd…
Rectangular Covering Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2727   Accepted: 769 Description n points are given on the Cartesian plane. Now you have to use some rectangles whose sides are parallel to the axes to cover them. Ever…
题目大意:在一个平面内有若干个点,要求用一些矩形覆盖它们,一个矩形至少覆盖两个点,可以相互重叠,求矩形最小总面积. 分析: 数据很小,很容易想到状压DP,我们把点是否被覆盖用0,1表示然后放在一起得到一个最多15位的二进制数字作为状态,对于每种状态枚举矩形,进行覆盖. 要进行一个预处理,将每种矩形多覆盖的点状态保存下来,并计算面积,然后就是DP了. 状态转移方程f[s2]=min(f[s2],f[s1]+area) s1为原来状态,s2表示后来放置矩形后的状态. 因为可以重复覆盖,计算s2不是s…
题目是平面上n个点,要用若干个矩形盖住它们,每个矩形上至少要包含2个点,问要用的矩形的面积和最少是多少. 容易反证得出每个矩形上四个角必定至少覆盖了两个点.然后就状压DP: dp[S]表示覆盖的点集为S要用的最少矩形面积 转移我一开始是未覆盖的点和已覆盖的点构成一个矩形来转移,这是错的,因为这样子的结果是所有矩形都相连的最小面积和. 正确的是枚举还未被覆盖的矩形来转移.转移我用我为人人+队列. 有一点要注意的是,覆盖(0,0)和(0,2)两点要用的矩形是1*2,所以要特判一下两点斜率0或不存在时…
题意 平面上有 n (2 ≤ n ≤ 15) 个点,现用平行于坐标轴的矩形去覆盖所有点,每个矩形至少盖两个点,矩形面积不可为0,求这些矩形的最小面积. Input The input consists of several test cases. Each test cases begins with a line containing a single integer n (2 ≤ n ≤ 15). Each of the next n lines contains two integers …
P2324 [SCOI2005]骑士精神 CF724B Batch Sort CF460C Present CF482A Diverse Permutation CF425A Sereja and Swaps CF1187C Vasya And Array P3419 [POI2005]SAM-Toy Cars CF196C Paint Tree *Loj #6560 小奇取石子 *CodeChef - CLPERM POJ2689. Prime Distance P1792 [国家集训队]种树…
http://poj.org/problem?id=1266 Cover an Arc. Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 823   Accepted: 308 Description A huge dancing-hall was constructed for the Ural State University's 80-th anniversary celebration. The size of t…