杭电 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 ...
随机推荐
- 039 Combination Sum 组合总和
给一组候选数字(C)(没有重复)并给一个目标数字(T),找出 C 中所有唯一的组合使得它们的和为 T.可以从 C 无限次数中选择相同的数字.说明: 所有数字(包括目标)都是正整数. 解集合 ...
- 《深入理解java虚拟机》笔记(2)HotSpot虚拟机对象探秘
一.对象的创建 1.类加载: 虚拟机在遇到一条new指令时候,检查类是否已被加载.解析.初始化过,如果没有,则执行类加载过程. 2.分配内存:类加载完成后,则为新对象从java堆上分配内存,分配内存有 ...
- JS的使用
Javascript代码在浏览器中运行,做出更流畅.优美的页面效果,增强用户体验与java是完全不同的东西,只是名称类似而已写在<script></script>标签中 大小写 ...
- Spring 计划任务
计划任务在Spring 中实现变得非常简单: 1. 首先通过在配置类中注解 @EnableScheduling 来开启对计划任务的支持 2. 然后在你执行任务的方法上注解 @Scheduled 来声明 ...
- 字符串在forEach方法里面可以使用include函数
今天在写项目的时候,发现了一个问题,使用forEach函数,arr数组里面的字符串可以调用include方法,我查阅了很多地方,string里面没有这个方法. 但是在forEach函数里面确实可以这样 ...
- 家校通Code
9 http://dlwt.csdn.net/fd.php?i=621573845033702&s=44d46a459acce7fef39aa4dcff51bfba
- js字符串、数组、时间、日期对象
js对字符串.数组.日期的操作是在以后项目中频繁使用的操作,所以呢....所以大家看着办,其实并不难哈,就是有点无聊,我承认这是我百度的,哈哈哈哈 <!DOCTYPE html><h ...
- 关系代数演算So Easy
关系代数运算So Easy 关系代数是以关系为运算的一组高级运算的集合.由于定义为属性个数 相同的元组的集合,因此集合代数的操作就可以引入到关系代数中.关系代数也可以看做是一种抽象的查询语言,是对关系 ...
- cv2.threshold 阈值灰度
threshold函数的使用 图像的二值化就是将图像上的像素点的灰度值设置为0或255,这样将使整个图像呈现出明显的黑白效果.在数字图像处理中,二值图像占有非常重要的地位,图像的二值化使图像中数据量大 ...
- python中os.listdir( )函数读取文件夹
编写pytohn脚本时通常需要批处理. 列出指定目录下的所有文件/文件夹 os.listdir() 方法用于返回指定的文件夹包含的文件或文件夹的名字的列表,但有个很明显的缺点,它的默认顺序不是有序的或 ...