HDU 4247 A Famous ICPC Team
For the first case, all suitcases have size 2x2. So they can perfectly be packed in a 4x4 large box without wasting any space. For the second case, three suitcases have size 2x2 and the last one is 1x1. No matter how you rotate or move the suitcases, the side length of the large box must be at least 4.
#include<stdio.h>
#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
double a[];
bool check(long long b)
{
if(b-a[]>=a[])
return true;
return false;
}
int main()
{
double maxn,minn,mid;
int t=;
while(cin>>a[]>>a[]>>a[]>>a[])
{
t++;
sort(a,a+);
minn=sqrt(a[]*a[]+a[]*a[]+a[]*a[]+a[]*a[]);
maxn=a[]*;
while(minn+0.1<maxn)
{
mid=(minn+maxn)/;
if(check(mid))maxn=mid;
else minn=mid;
}
printf("Case %d: %.0lf\n",t,minn);
}
return ;
}
HDU 4247 A Famous ICPC Team的更多相关文章
- HDU 4251 The Famous ICPC Team Again 主席树
The Famous ICPC Team Again Problem Description When Mr. B, Mr. G and Mr. M were preparing for the ...
- HDU 4251 The Famous ICPC Team Again(划分树)
The Famous ICPC Team Again Time Limit: 30000/15000 MS (Java/Others) Memory Limit: 32768/32768 K ( ...
- hdu 4251 The Famous ICPC Team Again划分树入门题
The Famous ICPC Team Again Time Limit: 30000/15000 MS (Java/Others) Memory Limit: 32768/32768 K ( ...
- HDOJ 4251 The Famous ICPC Team Again
划分树水题..... The Famous ICPC Team Again Time Limit: 30000/15000 MS (Java/Others) Memory Limit: 3276 ...
- 【HDOJ】4251 The Famous ICPC Team Again
划分树模板题目,主席树也可解.划分树. /* 4251 */ #include <iostream> #include <sstream> #include <strin ...
- HDU4251-The Famous ICPC Team Again(划分树)
Problem Description When Mr. B, Mr. G and Mr. M were preparing for the 2012 ACM-ICPC World Final Con ...
- HDU 2017 Multi-University Training Contest - Team 4 1009 1011
Questionnaire Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)T ...
- HDU 5475(2015 ICPC上海站网络赛)--- An easy problem(线段树点修改)
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=5475 Problem Description One day, a useless calculato ...
- hdu 4255 A Famous Grid
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4255 A Famous Grid Description Mr. B has recently dis ...
随机推荐
- template template parameter
#include <iostream> using namespace std; template<typename T> class A { }; template<t ...
- 浅析ARP协议及ARP攻击
一. ARP数据包结构 (1)硬件类型:指明发送方想知道的硬件接口类型,以太网的值为1:(2)协议类型:指明发送方提供的高层协议类型:它的值为 0x0800 即表示 IP地址.(3)硬件地址长度和协议 ...
- ng1笔记
AngularJS 通过 ng-directives 扩展了 HTML. ng-app 指令定义一个 AngularJS 应用程序. ng-model 指令把元素值(比如输入域的值)绑定到应用程序. ...
- 分离JavaScript
分离JavaScript类似于使用style属性,在HTML文档里使用诸如onclick之类的属性也是一种既没有效率又容易引发问题的做法.如果我们用一个"挂钩",就像CSS机制中的 ...
- CPU和GPU的区别
个人认为CPU和GPU各有自己的适应领域.CPU(Central Processing Unit)计算核心较少,通常是双核.四核.八核,但是拥有大量的共享缓存.预测.乱序执行等优化,可以做逻辑非常复杂 ...
- js实现复制内容
一.实现点击按钮,复制文本框中的的内容 <script type="text/javascript"> function ...
- Duilib使用wke显示echarts
不得不说wke是个简洁好用的浏览器内核.网上很多大神已经把wke嵌入到duilib中了,先感谢他们辛勤的工作.这里通过wke吧C++的数据在ECharts上美观的显示出来.借鉴前人,将ECharts进 ...
- 如何让有物理键的手机在ActionBar始终显示更多菜单menu键
仅作记录代码用,功能未能测试成功,在低版本上不存在 sHasPermanentMenuKey 属性,会出现 java.lang.NoSuchFieldException: sHasPermanentM ...
- "The Application was unable to start correctly (0xc000007b). Click OK to close the application"
我有时将MFC编译成64位并运行,就会报这个错误. 后来查找原因,就在于系统中使用了错误的dll.比如这个程序要使用64位的dll,而你拷贝进去的是同名的32位dll.解决方法就是放置正确的dll. ...
- C# 导出Word
导出word文档(无模版): using Microsoft.Office.Interop.Word; public static string CreateWordFile(CaseVM model ...