题目大意:给出k:绳子的劲度系数,l:绳长,s:桥高,w:邦德的质量,g取9.81。绳子弹力=形变量*劲度系数。如果落地速度大于10 则摔死,小于0则飘着空中。

题目思路:根据能量守恒得知:落地的动能=重力势能减少量-绳子弹力做功。如果l>s,则绳子不做功。

#include<cstdio>
#include<stdio.h>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#define INF 0x3f3f3f3f
#define MAX 1000005 using namespace std; int main()
{
double k,l,s,w,we,g=9.81,v;//we为落地式的动能
while(scanf("%lf%lf%lf%lf",&k,&l,&s,&w),k+l+s+w)
{
if(l > s)//如果绳子大于桥的高度绳子的弹力不会做功,落地时动能增量等于重力势能的减少量
{
v=sqrt(*g*s);
}
else//否则,落地时的动能等于重力势能的减少量-绳子弹力做功。绳子的平均弹力=平均形变量*k
{
we=w*g*s - ((s-l)/2.0)*(s-l)*k;
if(we < )//若果落地动能小于0,肯定在落地前速度就为0了,也就飘着了半空中
{
printf("Stuck in the air.\n");
continue;
}
v=sqrt((we*)/w);
} if(v > )
printf("Killed by the impact.\n");
else
printf("James Bond survives.\n");
}
return ;
}

HDU 1155 Bungee Jumping 物理的更多相关文章

  1. hdu 1155 Bungee Jumping

    http://acm.hdu.edu.cn/showproblem.php?pid=1155 Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) ...

  2. HDU 1155 Bungee Jumping(物理题,动能公式,弹性势能公式,重力势能公式)

    传送门: Bungee Jumping Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Othe ...

  3. 杭电 1155 Bungee Jumping(物理题)

    Problem Description Once again, James Bond is fleeing from some evil people who want to see him dead ...

  4. Bungee Jumping[HDU1155]

    Bungee JumpingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...

  5. HDU 5826 physics(物理)

     physics(物理) Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)   D ...

  6. HDU 1087 Super Jumping! Jumping! Jumping

    HDU 1087 题目大意:给定一个序列,只能走比当前位置大的位置,不可回头,求能得到的和的最大值.(其实就是求最大上升(可不连续)子序列和) 解题思路:可以定义状态dp[i]表示以a[i]为结尾的上 ...

  7. (简单的物理题)Bungee Jumping

    链接: http://acm.hdu.edu.cn/showproblem.php?pid=1155 Time Limit: 2000/1000 MS (Java/Others)    Memory ...

  8. UVa 10868 (物理) Bungee Jumping

    题意: 有个人在蹦极,给出悬崖的高度,绳子的长度,弹簧绳的胡克系数 以及 人的质量. 判断人是否能够着地,能的话是否能安全着地.所谓安全着地就是到达地面的速度不超过10m/s. 分析: 学过一点高中物 ...

  9. DP专题训练之HDU 1087 Super Jumping!

    Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is ve ...

随机推荐

  1. Graph Algorithm

    1.定义 A graph consists of a set of vertices V and a set of edges E. Each edge is a pair (v, w), where ...

  2. delphi中ShellExecute使用详解

    http://jingyan.baidu.com/article/ae97a646ae00a2bbfd461d38.html 百度的讲解 http://www.cnblogs.com/del/arch ...

  3. CALayer的隐式动画和显式动画

    隐式事务 任何对于CALayer属性的修改,都是隐式事务,都会有动画效果.这样的事务会在run-loop中被提交. - (void)viewDidLoad { //初始化一个layer,添加到主视图 ...

  4. Objective-C中关于请求返回NSData数据解析成NSDictionary或NSArray的方法

    1.如果后台返回的是字典或数组的data型,直接使用以下方法转换: { // Data 转成 字典 其中responseObject为返回的data数据 NSDictionary *resultDic ...

  5. kvstore存储介质redis代码

    <?php /** * ShopEx licence * * @copyright Copyright (c) 2005-2010 ShopEx Technologies Inc. (http: ...

  6. Smarty 注册变量

    关于smarty类的一些解析 特别注意左右分隔符<{}>,display------显示模板的内容(里面是.html文件),assign-------注册变量 <?php //是一个 ...

  7. ( ̄y▽ ̄)~ 智能手机II

    ( ̄y▽ ̄)~ 智能手机II TimeLimit: 3000/1000 MS (Java/Others)  MenoryLimit: 32768/32768 K (Java/Others) 64-bi ...

  8. beginBackgroundTaskWithExpirationHandle

    [[UIApllication sharedApplication] beginBackgroundTaskWithExpirationHandle:^{}];这个方法在app进入后台时,可以做一些事 ...

  9. #define const extern

    将父类中的常量放到. m文件,子类就不会重复包含了.之后再.h文件中用extern NSSting * const ILScoreShowStartTime;// extern 用来声明变量和函数.c ...

  10. C++内存申请容易产生的错误

    1.起因 前两天用python写了一款工具用来把excel文件转换成json文件,今天给他们用的时候发现在文本下看正常,但是在程序中使用就是会多出一些莫名其妙的字符. 2. 调查 原来主要是我写的工具 ...