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. 算法导论课后习题解答 第一部分 练习1.1-1->1.1-5

    很高兴能和大家一起共同学习算法导论这本书.笔者将在业余时间把算法导论后面的题解以博文的形式展现出来希望能得到大家的支持谢谢.如果有可能我会做一些教学视频免费的供大家观看. 练习题选自算法导论中文第三版 ...

  2. PS高级特训班 百度云资源(价值2180元)

    课程目录:   第1章第一期1第一节 火焰拳头1:12:252第二节 荷叶合成00:05:143第三节 新年巨惠海报(一)1:00:374第四节 新年巨惠海报(二)1:05:345第五节 美食印刷品1 ...

  3. Dell服务器安装系统中遇到的坑

    在本学期开学初期,由于后续实验的需要,老师为我们配置了服务器,该服务器的型号为Dell Power R730. 由于我也是一个小白,在服务器安装系统的过程中,遇到了一些麻烦,在这里记录下来,希望自己能 ...

  4. Dev控件工具箱安装

    安装目录\Components\Tools,打开命令行 安装DEV工具 $ ToolboxCreator.exe /ini:toolboxcreator.ini 移除DEV工具 $ ToolboxCr ...

  5. 基于JAVA的设计模式之单例模式

    概念 于大二上学期面向对象C++期中考试中有这么道题:一个Computer有多个USB插口,那么意味着这台电脑可以插多个鼠标,但是无论你如何拔插多少个鼠标,桌面上的鼠标一直只显示一个,且多个硬件鼠标都 ...

  6. Servlet中的初始化参数、上下文参数、以及@Resource资源注入

    配置初始化参数.上下文参数.以及使用@Resource注解进行资源注入,目的是为了降低代码的耦合度.当项目需求进行变更的时候,不需要反复更改源代码,只需更改web.xml文件即可. 一:Servlet ...

  7. God made relatives.Thank God we can choose our friends.

    God made relatives.Thank God we can choose our friends. 神决定了谁是你的亲戚, 幸运的是在选择朋友方面他给了你留了余地

  8. python生成器简单代码了理解。

    __author__ = 'ZHHT' #!/usr/bin/env python # -*- coding:utf-8 -*- #返回当前执行到的函数的返回值.并保持当前执行的状态.这时候先执行别的 ...

  9. css hack 浏览器携带自身特有的属性 (二)

    css hack 浏览器携带自身特有的属性,才是我们真正要解决的css 兼容问题. 这里只是分享思路. 举例子: 1 outline,尤其是一些 自带继承特性的属性.这里指的是 隐性的inherite ...

  10. tomcat服务器,从前端到后台到跳转

    前端页面: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <tit ...