#include<iostream>
#include<cstdio>
#include<cmath>
#define g 9.81
using namespace std;
int main()
{
double k,l,s,w;
while(scanf("%lf%lf%lf%lf",&k,&l,&s,&w)==4&&(k+l+s+w))
{
if(s<=l)
{
double v=2*s*g;
if(v<=100.0) printf("James Bond survives.\n");
else printf("Killed by the impact.\n");
}
else
{
double tmp1=w*g*s;
double tmp2=0.5*k*(s-l)*(s-l);
if(tmp1<tmp2) printf("Stuck in the air.\n");
else
{
double tmp=-0.5*k*(s-l)*(s-l)+w*g*(s-l)+0.5*w*2*g*l;
double v=tmp*2/ w;
if(v<=100.0) printf("James Bond survives.\n");
else printf("Killed by the impact.\n");
}
}
}
return 0;
}
UVA 10868(p345)----Bungee Jumping
最新推荐文章于 2022-08-29 17:48:23 发布
本文深入探讨了利用C++编程语言解决复杂问题的策略,重点介绍了数值方法、动态规划、贪心算法等经典算法在实际应用中的优化技巧。通过实例分析,展示了如何在特定问题场景下选择合适的算法,以及如何通过代码实现来提升程序性能。

453

被折叠的 条评论
为什么被折叠?



