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 ...
随机推荐
- JS 常用功能收集
JS 常用效果收集 1. 回到顶部>> 爱词霸
- Secondary Namenode - What it really do?
原文链接:http://blog.madhukaraphatak.com/secondary-namenode---what-it-really-do/ Secondary Namenode is o ...
- 切换self.window.rootViewController根视图,导致上一视图控制器不能释放销毁的问题
在我们APP开发中经常有首次进入应用先进入引导页或者登陆页的情况,类似下图所示 发现登陆以后更改window.rootViewController为应用首页时,登陆页没有销毁掉,通过图层工具 ...
- 【安装】beautifulsoup4—美丽汤的安装
beautifulsoup俗称美丽汤,是用来爬虫用的,大家可以到这个网址去下载.注意,要根据对应的python版本 来下载. 下载传送: https://pypi.python.org/pypi/be ...
- Objective-C Runtime 运行时之六:拾遗(转载)
前面几篇基本介绍了runtime中的大部分功能,包括对类与对象.成员变量与属性.方法与消息.分类与协议的处理.runtime大部分的功能都是围绕这几点来实现的. 本章的内容并不算重点,主要针对前文中对 ...
- 【IE6的疯狂之七】样式中文注释后引发失效
这是IE6 出现的奇怪现象.这是由于css 和html 的编码不同所引致. 满足下面条件就会引起 注释下面的样式不起作用:1. css有中文注释2. css为ANSI编码3. html为utf-8编码 ...
- redis配置文件redis.conf的参数说明
打开redis.conf文件: # By default Redis does not run as a daemon. Use 'yes' if you need it. # Note that R ...
- android相关内容
一: 前台进程: 前台的进程的优先级最高, 可见进程: android系统一般存在少量的可见进程. 服务进程: 没有用户界面, 后台进程: 一般存在较多的后台进程. 空进程: 不包括任何活跃组件的进程 ...
- Java 并发 线程的生命周期
Java 并发 线程的生命周期 @author ixenos 线程的生命周期 线程状态: a) New 新建 b) Runnable 可运行 c) Running 运行 (调用 ...
- AutoCAD 2009及以上 32位&64位 官方原版下载地址
AutoCAD 2017 AutoCAD 2017 简体中文版 32位 http://trial2.autodesk.com/NET17SWDLD/2017/ACD/DLM/AutoCAD_2017_ ...