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;其中L是形变量;k是绳子的劲度系数;

#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
#define g 9.81
int main()
{
    double k, l, s, w, e, v;
    while(scanf("%lf%lf%lf%lf", &k, &l, &s, &w), k+l+s+w)
    {
        e = w*g*s;
        if(s>l)
            e=e-k*(s-l)*(s-l)/2;
        if(e<0)
        {
            printf("Stuck in the air.\n");
            continue;
        }
        v=sqrt(2*e/w);
        if(v>10)
            printf("Killed by the impact.\n");
        else
            printf("James Bond survives.\n");
    }
    return 0;
}

时间: 2024-08-14 11:16:24

Bungee Jumping---hdu1155(物理题)的相关文章

杭电 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[HDU1155]

Bungee JumpingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1205 Accepted Submission(s): 528 Problem DescriptionOnce again, James Bond is fleeing from some evil people who want to see him dead. F

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 边形的 中心,也即江流儿的位置,从而完成追捕

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

(简单的物理题)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 s

HDU 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