HDU 5301 Buildings(2015多校第二场)
BuildingsTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Problem 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 in the shape of a rectangle. Each built wall must be paralled to the building's sides.
The floor is represented in the ground plan as a large rectangle with dimensions rev=2.4-beta-2" alt="" style="">, rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> located rev=2.4-beta-2" alt="" style=""> and rev=2.4-beta-2" alt="" style=""> must rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> square rev=2.4-beta-2" alt="" style="">. rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style="">.
Input
There are at most
rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> testcases. rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style=""> rev=2.4-beta-2" alt="" style="">.
Output
For each testcase, print only one interger, representing the answer.
Sample Input
Sample Output
Source
解题思路:
假设没有不合法的块,那结果就是长和宽中最小值的一半,而,不合法的块所影响的仅仅有它周围的四块,计算出这四块距离四个边的距离的最小值,就是加入上不合法块之后该块所须要的最长距离。 须要注意特判一中情况。即不合法块在正中间的时候,并不造成影响。 #include <iostream> |
最新文章
- nginx重写规则报nginx: [emerg] directive ";rewrite"; is not terminated by ";;";
- [ActionScript] AS3解决html与flash鼠标滚轮冲突的问题
- python之setattr,getattr,hasattr
- WPF、Silverlight项目中使用柱状图、饼状图、折线图
- 【转】Android SDK Manager 更新方法
- Linux DM9000网卡驱动程序完全分析
- Search Bars(一个)
- 最新swift4.0 图片进行尺寸大小及体积压缩
- 20162318 实验三《 敏捷开发与XP实践》实验报告
- iOS开发-简单的循环结构分析
- Tomcat系列(9)——Tomcat 6方面调优(内存,线程,IO,压缩,缓存,集群)
- b/s 和c/s的区别
- 6354	 Everything Has Changed
- JAVA第十次作业
- 5-15 bootcss 之 modal 以及 jquery ui 之datepicker 小记
- JavaScript开发工具大全
- JS 中 ~~符号
- cookie、sesstion、strorage
- OSGI命令
- Qt计算器开发(三):执行效果及项目总结