Bungee Jumping---hdu1155(物理题)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1155
题目很长,但是很容易理解,就是人从高s的桥上跳下来,手拉着长为l的绳子末端,如果绳子太短那么人将在空中输出Stuck in the air.
如果人落地速度大于10的话就死了,输出Killed by the impact.否则是活的输出James Bond survives.
简单的物理题:假如说人能到地上那么是重力势能转化成动能,其中会有绳子做负功;
G=mgh;
Wf=k*L*L/2;其中L是形变量;k是绳子的劲度系数;
G-Wf = ek = m*v*v/2
#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
#define g 9.81
int main()
{
double k, l, s, w, e, v;
while(scanf("%lf%lf%lf%lf", &k, &l, &s, &w), k+l+s+w)
{
e = w*g*s;
if(s>l)
e=e-k*(s-l)*(s-l)/;
if(e<)
{
printf("Stuck in the air.\n");
continue;
}
v=sqrt(*e/w);
if(v>)
printf("Killed by the impact.\n");
else
printf("James Bond survives.\n");
}
return ;
}
Bungee Jumping---hdu1155(物理题)的更多相关文章
- HDU 1155 Bungee Jumping(物理题,动能公式,弹性势能公式,重力势能公式)
传送门: Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ...
- 杭电 1155 Bungee Jumping(物理题)
Problem Description Once again, James Bond is fleeing from some evil people who want to see him dead ...
- Bungee Jumping[HDU1155]
Bungee JumpingTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...
- hdu 1155 Bungee Jumping
http://acm.hdu.edu.cn/showproblem.php?pid=1155 Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) ...
- Codeforces Round #114 (Div. 1) A. Wizards and Trolleybuses 物理题
A. Wizards and Trolleybuses Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/conte ...
- HDOJ 1330 Deck(叠木块-物理题啊!贪心算法用到了一点)
Problem Description A single playing card can be placed on a table, carefully, so that the short edg ...
- hdu 5761 Rower Bo 物理题
Rower Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 Description There is a river on the Ca ...
- hdu 5066 小球碰撞(物理题)
http://acm.hdu.edu.cn/showproblem.php?pid=5066 中学物理题 #include <cstdio> #include <cstdlib> ...
- hdoj 4445 Crazy Tank 物理题/枚举角度1
Crazy TankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
随机推荐
- vsearch 去除重复序列和singleton 序列
在16S数据分析中,为了减少聚类的时间,提高准确度,需要去除重复序列,而singleton序列因为没有其他的序列作为验证,可信度不是很高,也需要去除,通常情况下使用usearch 完成这2项任务,但是 ...
- python中使用@property
class Student(object): @property def score(self): return self._score @score.setter def score(self, v ...
- 原生js版ajax请求
function getXMLHttpRequest() { var xhr; if(window.ActiveXObject) { xhr= new ActiveXObject("Micr ...
- MVC下载远程文件流(WebClient)
public ActionResult DownLoad_File() { return File(ScLiu(PathUrl), "application/octet-stream&quo ...
- 火云开发课堂 - 《使用Cocos2d-x 开发3D游戏》系列 第四节:3D公告板
<使用Cocos2d-x 开发3D游戏>系列在线课程 第四节:3D公告板 视频地址:http://edu.csdn.net/course/attend/1330/20804 交流论坛:mo ...
- Android ListView圆角
首先来看看ListView 相关基本属性 1.单击列表后,列表的背景变成黑色了. 可通过指定android:cacheColorHint的属性来放变它,将它指定为透明. 使用以下的属性值: a ...
- 13年10月 月赛第一场 set 4 迷宫问题
题目 给定一个n*m的迷宫,如S....#E.E其中,S代表开始位置,#代表不可行走的墙,E代表出口.主人公从开始位置出发,每次等概率的随机选择下一个可以行走的位置(可能会发生回溯),直到到达某一个出 ...
- /var/log/spooler
/var/log/spooler 用来记录 Linux 新闻群组方面的日志,内容一般是空的,没什么用,了解即可
- 简要说说NUC972和linux的那些大坑
刚开始装虚拟机,按照步骤,一步一步,装完,发现虚拟机连不上网,后来在网上得知得需要启动虚拟机设置,可是观察我的虚拟机并没有该选项,起初我认为是版本的问题,可是后来才发现,一时贪便宜,图省事,就没有注册 ...
- c++11——可变参数模板
在c++11之前,类模板和函数模板只能含有固定数量的模板参数,c++11增加了可变模板参数特性:允许模板定义中包含0到任意个模板参数.声明可变参数模板时,需要在typename或class后面加上省略 ...