UVA 10868 - Bungee Jumping

本文通过分类讨论的方法,解析了一道涉及绳子长度与高度的物理题目。利用动能定理,针对不同情况(绳子长度大于或小于高度)进行分析,计算最终速度并判断结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

物理题。  很简单。  中间用到了 积分求 绳子做功。动能定理。


 分类讨论 绳子长度 与 高度。


当 绳子长度 大于 高度的时候  自由落体。


如果 高度 大于绳子长度  先自由落体  然后  重力 和  绳子拉力同时做功。  动能定理 求解 最终的 速度。  判断即可。




#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define ll long long
#define maxn 2000 + 10
int main (){
    double k,l,h,w;
    double g =9.81;
    while(scanf("%lf%lf%lf%lf",&k,&l,&h,&w)){
        if(k == 0 && l == 0 && h == 0 && w == 0)
        break;
        if(l >= h){
            double v = sqrt(2*g*h);
            if(v > 10)
                printf("Killed by the impact.\n");
            else
                printf("James Bond survives.\n");
        }
        else{
            double v0 = sqrt(2*g*h);
            double x = w*g*(h-l) - 0.5*k*(h - l)*(h - l) + g*l*w;
            if(x < 0)
                printf("Stuck in the air.\n");
            else{
                double v = sqrt(x * 2 / w);
                if(v <= 10)
                    printf("James Bond survives.\n");
                else
                    printf("Killed by the impact.\n");
            }
        }
    }
    return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值