poj 2463 物理水题(机械能守恒定理)
2011-09-17 16:23
190 查看
题意:James Bond 为了逃命,要绑着橡皮绳从桥上跳下,若他不能到达地面则输出Stuck in the air. 若到达地面的速率大于10m/s 输出Killed by the impact. 若到达地面速率小于10m/s 输出James Bond survives.
#include <iostream> using namespace std; const float g = 9.81f; int main() { float k, l, s, w; float v2; while(scanf("%f%f%f%f", &k, &l, &s, &w)) { if(!k && !l && !s && !w) break; if(l >= s) { // 当绳长大于桥的高度时,全程自由落体运动,直接求落地速率,并进行判断 v2 = 2*g*s; if(v2 > 100) { printf("Killed by the impact.\n"); } else { printf("James Bond survives.\n"); } continue; } else { if(k*(s-l)*(s-l)/2 > w*g*s) /* 假设到达地面时,如果此时的弹性势能已经大于最初人 总共的重力势能,说明人的动能为负,这是不可能的, 说明人在到达地面之前,速率就已经减到0了。*/ { printf("Stuck in the air.\n"); continue; } v2 = 2*g*s-k*(s-l)*(s-l)/w; // 能够到达地面时求到达地面时的速率的平方。 if(v2 > 100) { printf("Killed by the impact.\n"); } else { printf("James Bond survives.\n"); } continue; } } return 0; }
相关文章推荐
- Bungee Jumping 【物理 机械能守恒】
- POJ-1063 Flip and Shift 数学分析&运用守恒定理
- POJ2463-Bungee Jumping-物理题
- 每日ACM小题--POJ1006——中国剩余定理的完美诠释 2013年11月04(附录POJ_1005水题一枚)
- POJ-2463 Bungee Jumping (简单物理题)
- POJ 1006 Biorhythms 中国剩余定理
- 【POJ 1287】Networking(最小生成树-水题)
- POJ 2367 -- Genealogical tree【拓扑排序 && 水题】
- poj 1006 中国剩余定理模板
- POJ 3566 Building for UN (无脑构造 水题)
- [POJ 1200] Crazy Search (水题)
- Poj Trie树 水题整理 (Poj 1065+1204+2001+2418)
- POJ 1284 Primitive Roots (欧拉函数&原根定理)
- Poj 1833 排列 —— 一道水题的凌乱
- poj 2891 Strange Way to Express Integers 模数不互素的中国剩余定理
- poj 2386 深搜水题
- POJ 3628 Bookshelf 2 0-1背包 or DFS 水题
- poj--3624--Charm Bracelet(动态规划 水题)
- POJ 3100 Root of the Problem (水题)
- POJ 1265 Area(ZOJ 1032)(pick定理)