题意:有一个包含n*m个格子的矩阵,其中有一个格子已经被染黑,现在要拿一些矩形来填充矩阵,不能填充到黑格子,但是每一个填充进去的矩形都必须至少有一条边紧贴在矩阵的边缘(4条边)的.用于填充的矩形其中最大面积的一个的面积大小为B,要使得B最小,如何填充? 思路: 由于每个格子(除了黑格子)都必须被覆盖到,而且又要面积尽量小,那么最小就是宽为1的矩形了,只是长应该是多少?如果给的是个长方形矩阵,当没有黑格子时,大概只要宽的一半就可以了吧?可是就是有了黑格子,为了找个坑,必须给个黑格子,不然也太简单了…
Buildings 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5301 Description Your current task is to make a ground plan for a residential building located in HZXJHS. So you must determine a way to split the floor building with walls to make apartments…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5301 题意:给你一个n*m的矩形,可以分成n*m个1*1的小矩形,再给你一个坐标(x,y),表示黑格子在n*m矩形中的位置,黑格子占一个1*1的小矩形的空间,用各种矩形去填充n*m矩形,(x,y)位置不能填,且每个去填充的小矩形都有一边是靠着n*m矩形的外框,求这些填充的小矩形在最小大小情况下的面积最大的矩形面积. 思路:要是填充的矩形大小最小,那么靠近边框的长度一定为1,所以只要判断在矩形内部的长…
Buildings Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 387 Accepted Submission(s): 81 Problem Description Your current task is to make a ground plan for a residential building located in HZXJ…
Buildings Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 759    Accepted Submission(s): 210 Problem Description Your current task is to make a ground plan for a residential building located…
Buildings Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 185    Accepted Submission(s): 25 Problem Description Your current task is to make a ground plan for a residential building located i…
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=4302 [题解] 出自2015多校-学军 题意大概是给出一个n*m的格子有一个格子(x,y)是坏的,用一些矩形覆盖没有坏的格子,使得每个矩形都有一面靠着边界.求最大的矩形的面积最小. 稍微分析就会发现肯定是1*x的矩形最优,因为如果是2*x可以分成2个1*x. 那么我们先把矩形转转位置,使得n<=m,且(x,y)在左上角. 矩形内没有坏点,显然方案是(n+1)/2 我们画个图,黑色的那个是坏…
HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen("D:\\input.txt", "r", stdin); #endif int a, b, c, n; scanf("%d", &n); while (n--){ scanf("%d%d", &a, &b); a…
题目传送门 /* 题意:n*m列的矩阵,删除一个格子x,y.用矩形来填充矩阵.且矩形至少有一边是在矩阵的边缘上. 求满足条件的矩形填充方式中面积最大的矩形,要使得该最大矩形的面积最小. 分析:任何矩形都可以分为宽度为1的小矩形,所以只考虑矩形的可以的最小长度即可. 讨论方法:这里 (我不会...) */ #include <cstdio> #include <algorithm> #include <cstring> using namespace std; typed…
Problem Description We divide the HZNU Campus into N*M grids. As you can see from the picture below, the green grids represent the buidings. Given the size of the HZNU Campus, and the color of each grid, you should count how many green grids in the N…