(简单的物理题)Bungee Jumping

链接:

http://acm.hdu.edu.cn/showproblem.php?pid=1155

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 793    Accepted Submission(s): 342

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.

用的动能定理~~~~~~~

Ep=mgh,Ek=k*x*x/2;

代码:

#include<stdio.h>
#include<math.h>
const double G=9.81;
int main()
{
    double k,l,s,w;
    while(scanf("%lf%lf%lf%lf",&k,&l,&s,&w))
    {
        if(k==0&&l==0&&s==0&&w==0)break;
        double e=w*G*s;
        if(s>l)e-=k*(s-l)*(s-l)/2;
        if(e<0)
        {
            printf("Stuck in the air.\n");
            continue;
        }
        double v=sqrt(e*2/w);
        if(v>10) printf("Killed by the impact.\n");
        else printf("James Bond survives.\n");
    }
    return 0;
}
时间: 2024-08-05 14:37:19

(简单的物理题)Bungee Jumping的相关文章

Bungee Jumping---hdu1155(物理题)

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1155 题目很长,但是很容易理解,就是人从高s的桥上跳下来,手拉着长为l的绳子末端,如果绳子太短那么人将在空中输出Stuck in the air. 如果人落地速度大于10的话就死了,输出Killed by the impact.否则是活的输出James Bond survives. 简单的物理题:假如说人能到地上那么是重力势能转化成动能,其中会有绳子做负功: ep=mgh: Wf=k*L*L/2;其

杭电 1155 Bungee Jumping(物理题)

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

Bungee Jumping POJ - 2463

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,

一道物理题

好久没来填坑了[手动捂脸熊] 啦啦啦物理考试终于结束了.. 所以水一波物理题...看!下!面!↓ 逃离(escape)Description 可怜的江流儿被困在了一个正 N 边形的中心.而追捕它的 N 只山妖存在于 正 N 边形的每个顶点上.山妖们按照顺时针方向,用 1~N 标号,因为山妖很傻, 所以每个山妖 i 都会朝 i+1 号山妖以一个固定的速率移动,移动方向会随着 i+1 位置变化而变化(N 号山妖朝 1 号山妖),最终所有山妖都将到达正 N 边形的 中心,也即江流儿的位置,从而完成追捕

Codeforces Round #259 (Div. 2) (简单模拟实现题)

题目链接:http://codeforces.com/problemset/problem/454/A A. Little Pony and Crystal Mine time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Twilight Sparkle once got a crystal from the Crystal Mine

fzu 1920 Left Mouse Button(简单深搜题)

题目地址:http://acm.fzu.edu.cn/problem.php?pid=1920 题目大意是给定一个n*n的图,模拟扫雷游戏,0代表没有雷区,1代表附近九宫格内只有一个雷-- 如果不懂的话去玩下扫雷,挺好玩的,99个雷的玩了好几百盘才赢了一次............ 此题假设神操作,点不到雷,问你最少要多少下才可以把图中非雷的点完,怎么样才最快呢? 当然先点0啦,,,,,,,, 好吧,不废话了..... ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1

HDU 1155 Bungee Jumping

题意:英语水平太次…………读了好久好久好久才读懂OTZ James Bond要逃跑,跑到一个桥边上,要跳到地面,桥边有个有弹性的绳子长度为l,如果他跳下去能到达地面,但速度超过10就会摔死,否则能成功降落,如果不能到达地面则被吊在绳子上(吐槽:为什么不看接近地面就直接跳下去= =).桥的高度为s,人的重力为w × 9.81,绳的弹力为k × Δl. 解法:一个物理题……物理太渣算了好久……首先看绳长是不是比桥的高度长,如果绳更长则这个人一定会接触地,则在他接触地的时候没有弹力的作用,列出式子:1

hdoj 4445 Crazy Tank 物理题/枚举角度1

Crazy TankTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5033    Accepted Submission(s): 1017 Problem DescriptionCrazy Tank was a famous game about ten years ago. Every child liked it. Time fli

[物理题+枚举] hdu 4445 Crazy Tank

题意: 给你N个炮弹的发射速度,以及炮台高度H和L1,R1,L2,R2. 问任选发射角度.最多能有几个炮弹在不打入L2~R2的情况下打入L1~R1 注意:区间有可能重叠. 思路: 物理题,发现单纯的依据V去求X很困难. 这个时候想到暴力枚举角度.for(double i=0; i<=pi; i+=0.0007) 算出能到达的x.然后推断x,统计sum 发现以增长级0.0007弧度 刚刚好能过这道题 反正也是醉了~ 代码: #include"cstdlib" #include&qu