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 ...
随机推荐
- D3.js:交互式操作
用户用于交互的工具一般有三种:鼠标.键盘.触屏. 1. 添加交互 对某一元素添加交互操作十分简单,代码如下: //画布大小 var width = 500, height = 500; // 在bod ...
- 用R语言 做回归分析
使用R做回归分析整体上是比较常规的一类数据分析内容,下面我们具体的了解用R语言做回归分析的过程. 首先,我们先构造一个分析的数据集 x<-data.frame(y=c(102,115,124,1 ...
- 使用 FormsAuthentication 来进行登录验证
1.在web.config文件中,<system.web>/<authentication>配置节用于对验证进行配置.为<authentication>节点提供mo ...
- CodeForces 675D Tree Construction
递归,$RMQ$. 因为$n$较大,可以采用递归建树的策略. 对每一个点标一个$id$.然后按照$v$从小到大排序,每一段$[L,R]$的根节点就是$id$最小的那个. 因为二叉搜索树可能是一条链,所 ...
- could not resolve property问题(ssh框架)
could not resolve property不能解析属性问题, 刚开始把hql语句中的"from User user where user.user_name = '"+u ...
- 安卓activity之间值共享解决办法,tabhost之间共享父类值,字符串类型的转换,获取每一个listview的item
1.tabhost父类值共享的解决办法 dianzhanliebiao.java是传值页面,zhuyemian.java放的是tabhost,dianzhangaikuang.java是tabhost ...
- C语言之字符串典型例题解析
今天又遇见几个好题,和以前的一些凑一块写一篇文章,作为我延迟去自习室的一个借口吧. 首先是第一题 int fun(char* s){ char* t = s; while(*t++); return ...
- 梅特卡夫法则(Metcalfe's law)
如果一个网络中有n个人,那么网络对于每个人的价值与网络中其他人的数量成正比,于是网络对于所有人的总价值与n*(n-1)成正比.
- [ An Ac a Day ^_^ ] [kuangbin带你飞]专题十二 HDU 1176 免费馅饼
题意: 中文题意不解释…… 思路: 先把x,T存到矩阵里 然后像数塔一样从最底层走一边就行了 dp[i][j]代表在时间为j时 第i个位置最多能吃到多少个馅饼 最后输出第0时刻的5位置的馅饼数量就好了 ...
- EF OrderBy(string propertyname), OrderByDescending(string propertyname) 按属性排序,扩展方法
public static class LinqExtensions { private static PropertyInfo GetPropertyInfo(Type objType, strin ...