UVA 10868 - Bungee Jumping
来源:互联网 发布:centos7打开8080端口 编辑:程序博客网 时间:2024/05/01 11:35
这道题很简单,直接AC就可以了。
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#define M 1
using namespace std;
int main()
{
double k,l,s,m,g,v,ll,lll;
g=9.81;
while(cin>>k>>l>>s>>m &&(k||l||s||m))
{
if(s<=l+1e-6)
{
v=sqrt(2*g*s);
if((v-10.0)>1e-6)
cout<<"Killed by the impact."<<endl;
else
cout<<"James Bond survives."<<endl;
continue;
}
ll=m*g/k;
if(s<=(l+ll+1e-6))
{
s-=l;
double a=(m*g+m*g-k*s)/2/m;
v=sqrt(2*g*l+2*a*s);
if((v-10.0)>1e-6)
cout<<"Killed by the impact."<<endl;
else
cout<<"James Bond survives."<<endl;
continue;
}
lll=sqrt(m*(2*g*l+m*g*g/k)/k);
if(s<=(l+ll+lll+1e-6))
{
s=s-l-ll;
v=sqrt(k*(lll+s)/m*(lll-s));
if((v-10.0)>1e-6)
cout<<"Killed by the impact."<<endl;
else
cout<<"James Bond survives."<<endl;
continue;
}
cout<<"Stuck in the air."<<endl;
}
return 0;
}
- UVA 10868 - Bungee Jumping
- UVA 10868 - Bungee Jumping
- UVa 10868 - Bungee Jumping
- UVA 10868(p345)----Bungee Jumping
- UVa 10868 - Bungee Jumping(物理公式)
- HOJ 2105 Bungee Jumping
- 中级5 Bungee jumping
- Bungee Jumping(基础物理)
- HDU 1155 Bungee Jumping
- HDOJ 1155 Bungee Jumping
- HDU-1155-Bungee Jumping
- 【POJ2463】Bungee Jumping
- HDU-1115 Bungee Jumping
- 2463 -- Bungee Jumping
- hdu 1155 Bungee Jumping
- [物理题] hdu 1155 Bungee Jumping
- hdu1155 Bungee Jumping(物理题)
- HDOJ-----1155Bungee Jumping物理题
- poj 1733 Parity game 并查集 离散化
- Hadoop之压缩
- 常见多线程与并发服务器设计方案举例
- js 操作select和option
- Nginx调试汇总
- UVA 10868 - Bungee Jumping
- jquery 获取URL参数并转码
- Neutron印象1:neutron简介
- C语言有符号加减溢出
- 关于solaris系统下的客户端配置
- QQ绑定手机就安全???——————【Badboy】
- [Matlab]技巧笔记
- Windows下,当一个文件夹里包含几十万个1K左右的小文件时(举个例子),最有效的删除方法。
- jQuery学习笔记之十四------工具函数