Problem Description

Once again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope on a nearby highway bridge which he can use to escape from his enemies. His plan is to attach one end of the rope to the bridge, the other end of the rope to his body and jump off the bridge. At the moment he reaches the ground, he will cut the rope, jump into his car and be gone.

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

350 20 30 75
375 20 30 75
400 20 30 75
425 20 30 75
450 20 30 75
400 20 30 50
400 20 30 80
400 20 30 85
0 0 0 0
 

Sample Output

Killed by the impact.
James Bond survives.
James Bond survives.
James Bond survives.
Stuck in the air.
Stuck in the air.
James Bond survives.
Killed by the impact.
 
物理题,求一个人从桥上用绳子跳下的三种状态,绳子有弹性,劲度系数为k,若人落地的速度大于10就会摔死。
思路:
  先求出人从桥到地的重力势能Eg,速度为10的动能Ev,绳拉到地( 绳不一定能到地面,假设到地 ) 的弹性势能Ek,先比较绳的长度和桥的高度,若绳长大于桥高,判断Eg和Ev的大小;
若绳长小于桥高,比较Eg和Ek的大小,Eg < Ek说明人不会落地,否则比较Eg-Ek和Ev的大小。
 /*
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(物理题)的更多相关文章

  1. HDU 1155 Bungee Jumping 物理

    题目大意:给出k:绳子的劲度系数,l:绳长,s:桥高,w:邦德的质量,g取9.81.绳子弹力=形变量*劲度系数.如果落地速度大于10 则摔死,小于0则飘着空中. 题目思路:根据能量守恒得知:落地的动能 ...

  2. hdu 1155 Bungee Jumping

    http://acm.hdu.edu.cn/showproblem.php?pid=1155 Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) ...

  3. HDU 1155 Bungee Jumping(物理题,动能公式,弹性势能公式,重力势能公式)

    传送门: Bungee Jumping Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  4. 杭电1087 Super Jumping! Jumping! Jumping!(初见DP)

    Super Jumping! Jumping! Jumping! Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 ...

  5. 胜利大逃亡(杭电hdu1253)bfs简单题

    胜利大逃亡 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Subm ...

  6. HDU 4968(杭电多校#9 1009题)Improving the GPA (瞎搞)

    题目地址:HDU 4968 这题的做法是全部学科的学分情况枚举,然后推断在这样的情况下是否会符合平均分. 直接暴力枚举就可以. 代码例如以下: #include <cstring> #in ...

  7. 杭电1081 第二道 dfs题

    Problem Description 呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个 ...

  8. HDU 4970(杭电多校#9 1011题)Killing Monsters(瞎搞)

    题目地址:HDU 4970 先进行预处理.在每一个炮塔的火力范围边界标记一个点. 然后对每一个点的伤害值扫一遍就能算出来. 然后在算出每一个点到终点的总伤害值,并保存下来,也是扫一遍就可以. 最后在询 ...

  9. hdu6373 Pinball 杭电第六场 物理知识

    Pinball Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total S ...

随机推荐

  1. ML.NET 示例:目录

    ML.NET 示例中文版:https://github.com/feiyun0112/machinelearning-samples.zh-cn 英文原版请访问:https://github.com/ ...

  2. win10红警黑屏和无法打开的处理

    原因:win10或者win7无法打红警的原因,除开软件本身坏了等情况,多半是因为显示比率不对不上和系统不兼容导致的处理方法是: 1.将快捷方式发送到桌面(只是为了方便打开,当然你也可以不发送到桌面,关 ...

  3. wepy开发踩坑记录

    与vue的不同 methods对象只存放tap等事件触发时的方法 events对象只存放$emit及$broadcast方法触发的事件 自定义方法及属性放在与methods平级的位置 props是动态 ...

  4. NOPI Excel 读取公式生成后的数据

    using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using S ...

  5. Vue.js之vue-router路由

    vue学习的一系列,全部来自于表哥---表严肃,是我遇到过的讲课最通透,英文发音最好听的老师,想一起听课就去这里吧 https://biaoyansu.com/i/hzhj1206 1概述 vue-r ...

  6. CA、公钥、私钥 概要

    CA.公钥.私钥 概要 现在在开发中遇到一个需求,需要使用tls加密技术,之前并没有了解过,这里来做一个关于CA,公钥,密钥的总结,至于怎么生成这儿就不讲了,如果有机会可以再开一个单章来讲一下. 现在 ...

  7. ribbon hystrix仪表盘

    Circuit Breaker: Hystrix Dashboard (断路器:hystrix 仪表盘) 基于service-ribbon 改造下: pom.xml加入: <dependency ...

  8. 适配器模式和php实现

    1. 概述 将一个类的接口转换成客户希望的另外一个接口.Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以在一起工作. 2. 解决的问题 即Adapter模式使得原本由于接口不兼容而不 ...

  9. zTree使用随笔

    最近开发过程中,需要写一个公司人员组织架构的树状图,后来选用了依赖jQuery的zTree插件来实现,主要是该插件功能齐全,性能稳定,个性化编辑方便,遂选用了这个插件.我记录了一下根据自身需求定制化修 ...

  10. UVA 12405 Scarecrow (基础DP)

    题意: 给出一个1*N的矩阵(就是一行的格子),其中部分格子可以有草,部分无草,现在要求放置一些稻草人在某些格子上,每个稻草人可以覆盖3个连续格子,为使得有草的格子都能被覆盖,问最少放置几个稻草人. ...