杭电 1155 Bungee Jumping(物理题)
Problem Description
Unfortunately, he had not had
enough time to calculate whether the bungee rope has the right length, so it is
not clear at all what is going to happen when he jumps off the bridge. There are
three possible scenarios:
The rope is too short (or too strong), and James
Bond will never reach the ground.
The rope is too long (or too weak), and
James Bond will be going too fast when he touches the ground. Even for a special
agent, this can be very dangerous. You may assume that if he collides at a speed
of more than 10 m/s, he will not survive the impact.
The rope's length and
strength are good. James Bond touches the ground at a comfortable speed and can
escape.
As his employer, you would like to know whether James Bond survives
or whether you should place a job ad for the soon-to-be vacant position in the
local newspaper. Your physicists claim that:
The force with which James is
pulled towards the earth is
9.81 * w,
where w is his weight in kilograms
and 9.81 is the Earth acceleration in meters over squared seconds.
Mr. Bond
falls freely until the rope tautens. Then the force with which the bungee rope
pulls him back into the sky depends on the current length of the rope and is
k * Δl,
where Δl is the difference between the rope's current length and
its nominal, unexpanded length, and k is a rope-specific constant.
Given the
rope's strength k, the nominal length of the rope l in meters, the height of the
bridge s in meters, and James Bond's body weight w, you have to determine what
is going to happen to our hero. For all your calculations, you may assume that
James Bond is a point at the end of the rope and the rope has no mass. You may
further assume that k, l, s, and w are non-negative and that s <
200.
The input contains several test cases, one test case per line. Each
test case consists of four floating-point numbers (k, l, s, and w) that describe
the situation. Depending on what is going to happen, your program must print
"Stuck in the air.", "Killed by the impact.", or "James Bond survives.". Input
is terminated by a line containing four 0s, this line should not be processed.
Sample Input
Sample Output
/*
k 绳子劲度系数
l 绳长
s 桥的高度
w 体重
*/
#include<cstdio>
#define g 9.81
int main()
{
double k,l,s,w;
double Eg,Ek,Ev;
while(scanf("%lf %lf %lf %lf",&k,&l,&s,&w)&&(k+l+s+w))
{
Eg=w*g*s;
Ev=*w/;
Ek=k*(s-l)*(s-l)/;
if(l >= s)
{
if(Eg <= Ev)
printf("James Bond survives.\n");
else
printf("Killed by the impact.\n");
}
else
{
if(Eg < Ek)
printf("Stuck in the air.\n");
else if(Eg-Ek <= Ev)
printf("James Bond survives.\n");
else
printf("Killed by the impact.\n");
} } }
杭电 1155 Bungee Jumping(物理题)的更多相关文章
- HDU 1155 Bungee Jumping 物理
题目大意:给出k:绳子的劲度系数,l:绳长,s:桥高,w:邦德的质量,g取9.81.绳子弹力=形变量*劲度系数.如果落地速度大于10 则摔死,小于0则飘着空中. 题目思路:根据能量守恒得知:落地的动能 ...
- hdu 1155 Bungee Jumping
http://acm.hdu.edu.cn/showproblem.php?pid=1155 Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) ...
- HDU 1155 Bungee Jumping(物理题,动能公式,弹性势能公式,重力势能公式)
传送门: Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ...
- 杭电1087 Super Jumping! Jumping! Jumping!(初见DP)
Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 ...
- 胜利大逃亡(杭电hdu1253)bfs简单题
胜利大逃亡 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...
- HDU 4968(杭电多校#9 1009题)Improving the GPA (瞎搞)
题目地址:HDU 4968 这题的做法是全部学科的学分情况枚举,然后推断在这样的情况下是否会符合平均分. 直接暴力枚举就可以. 代码例如以下: #include <cstring> #in ...
- 杭电1081 第二道 dfs题
Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个 ...
- HDU 4970(杭电多校#9 1011题)Killing Monsters(瞎搞)
题目地址:HDU 4970 先进行预处理.在每一个炮塔的火力范围边界标记一个点. 然后对每一个点的伤害值扫一遍就能算出来. 然后在算出每一个点到终点的总伤害值,并保存下来,也是扫一遍就可以. 最后在询 ...
- hdu6373 Pinball 杭电第六场 物理知识
Pinball Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total S ...
随机推荐
- NET Core:部署项目到Ubuntu Server
NET Core:部署项目到Ubuntu Server 概述 基于上一篇成功安装Ubuntu Server 16.10的基础上,接下来继续我们ASP.NET Core项目的部署之旅! 只是对于这些年整 ...
- shell 获得调用的python脚本的print值和错误log
1. shell 获得调用的python脚本的print值 python test.py > out.log 2.shell 获得调用的python脚本的错误log python test.py ...
- HDU 2899Strange fuction(模拟退火)
题意 题目链接 求 $F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)$的最小值 Sol 强上模拟退火,注意eps要开大! /* */ ...
- 8.html表格相关的标记9.html表格实战《简单的网页布局》
<html> <head> <title>第八课标题表格</title> <meta charset="utf-8"> ...
- typedef int status
是个自定义类型的语句,typedef用来定义类型的别名,status i 就相当于int i
- shell脚本安装nginx
#!/bin/bash N_url="http://nginx.org/download/nginx-1.8.0.tar.gz" N_pack=`echo $N_url|awk - ...
- 两个div并列居中显示——当display:inline-block;时,两个div无法对齐即一高一矮
解决办法: 给div添加样式vertical-align: top;
- jquery.page.js插件在使用时重复触发“上一页”和“下一页”操作
jquery.page.js使用demo HTML代码 <div class="result"> <div class="tcdPageCode&quo ...
- HDU 1124 Factorial (阶乘后缀0)
题意: 给一个数n,返回其阶乘结果后缀有几个0. 思路: 首先将n个十进制数进行质因数分解,观察的得到只有2*5才会出现10.那么n!应含有min(2个数,5个数)个后缀0,明显5的个数必定比2少,所 ...
- 在浏览器里使用SAPGUI
事务码SICF,service name输入WEBGUI, 点右键,选择Test Service: 可以在浏览器里敲SE38进入ABAP editor了: 然么缺乏语法高亮显示: 如果想要浏览器里的语 ...