HOJ 2105 Bungee Jumping
来源:互联网 发布:杭州g20知乎 编辑:程序博客网 时间:2024/04/18 12:06
http://acm.hit.edu.cn/hoj/problem/view?id=2105
已知绳子劲度系数为k 原长为l 桥高为s某人体重为w
重力加速度g=9.81
剩下是一个物理问题:
① 原长小于桥高
kΔl>2wgs//劲度系数太大在空中下不来
v=sqrt(2*g*s-((k*(s-l)*(s-l)/w))); //末速度v>10就挂了
② 原长大于等于桥高
看末速度
#include <stdio.h>#include <math.h>int main(){ double k, l, s, w, v; const double g = 9.81; while (scanf("%lf %lf %lf %lf", &k, &l, &s, &w) != EOF) { if ( (k == 0) && (l == 0) && (s == 0) && (w == 0) ) break; if (l < s) { if (k * (s - l) * (s - l) > 2 * w * g * s) { printf("Stuck in the air.\n"); continue; } v = sqrt( 2 * g * s - ( (k * (s - l) * (s - l) / w) ) ); if (v > 10) { printf("Killed by the impact.\n"); } else { printf("James Bond survives.\n"); } } else if (2 * g * s > 100) { printf("Killed by the impact.\n"); } else printf("James Bond survives.\n"); } return 0;}
- HOJ 2105 Bungee Jumping
- 中级5 Bungee jumping
- UVA 10868 - Bungee Jumping
- UVA 10868 - Bungee Jumping
- UVa 10868 - 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
- UVA 10868(p345)----Bungee Jumping
- hdu1155 Bungee Jumping(物理题)
- HDOJ-----1155Bungee Jumping物理题
- POJ 2463 Bungee Jumping G++
- 寻找数组的最大值与最小值
- apache http server 开启ssl 与tomcat交互
- 程序员的学习和积累
- 什么是真正的程序员? 知乎热议
- LDD3源码分析之llseek分析(二)
- HOJ 2105 Bungee Jumping
- 基础语言-题目74(小学算术)
- 全志A10 android平台CVBS效果调试
- 链式栈
- 如何更改c#项目的App.config文件
- The True Story of Hello World
- 什么是委托
- Here I am,it‘s a new start
- 扫雷程序完美版!!!!!!可以通过点击鼠标来翻开格子或者做上标记 !!!!!!!