UVA 10868 - Bungee Jumping
来源:互联网 发布:分离音频的软件 编辑:程序博客网 时间:2024/05/01 12:26
物理题。 很简单。 中间用到了 积分求 绳子做功。动能定理。
分类讨论 绳子长度 与 高度。
当 绳子长度 大于 高度的时候 自由落体。
如果 高度 大于绳子长度 先自由落体 然后 重力 和 绳子拉力同时做功。 动能定理 求解 最终的 速度。 判断即可。
#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 + 10int 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;}
0 0
- UVA 10868 - Bungee Jumping
- UVA 10868 - Bungee Jumping
- UVa 10868 - Bungee Jumping
- UVA 10868(p345)----Bungee Jumping
- UVa 10868 - Bungee Jumping(物理公式)
- HOJ 2105 Bungee Jumping
- 中级5 Bungee jumping
- Bungee Jumping(基础物理)
- HDU 1155 Bungee Jumping
- HDOJ 1155 Bungee Jumping
- HDU-1155-Bungee Jumping
- 【POJ2463】Bungee Jumping
- HDU-1115 Bungee Jumping
- 2463 -- Bungee Jumping
- hdu 1155 Bungee Jumping
- [物理题] hdu 1155 Bungee Jumping
- hdu1155 Bungee Jumping(物理题)
- HDOJ-----1155Bungee Jumping物理题
- tp模板中JS正则没效果
- C++基础之编写String类(拷贝构造函数)
- powershell 查看程序的tcp网络连接
- 强力查找替换命令,慎用
- hdu1208Pascal's Travels
- UVA 10868 - Bungee Jumping
- sqrt源码
- hdu-oj 1718 Rank
- Spark教程-构建Spark集群-配置Hadoop单机模式并运行Wordcount(2)
- poj 3668
- C++ ofstream和ifstream
- 开始运行命令集锦”
- JAVA RSA签名 验签 以及 加密解密
- 程序运行地址和加载地址-为什么使用位置无关指令