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 ...
随机推荐
- Session超时问题(AOP 过滤器)
public class TimeoutAttribute : ActionFilterAttribute { public override void OnActionExecuting(Actio ...
- docker和kubernetes docker的区别
之前公司的测试环境,刚开始自己搭建虚拟机,然后安装redis,nginx,mq,mysql,tomcat,jdk,marven,还有jekins.前面些还算好点,jekins还是比较麻烦的.然后搭完以 ...
- 查询_修改SQL Server 2005中数据库文件存放路径
1.查看当前的存放路径: select database_id,name,physical_name AS CurrentLocation,state_desc,size from sys.maste ...
- Unity文件操作路径
Unity3D中的资源路径: Application.dataPath:此属性用于返回程序的数据文件所在文件夹的路径.例如在Editor中就是Assets了. Application.streamin ...
- Unity3D Android手机屏幕分辨率问题
Android手机屏幕分辨率五花八门,导致开发时不好把握,还好各个引擎对这个屏幕分辨率问题都有较好的处理方式:unity3D 也为我们提供了一个不错的解决方案. 在Unity3D 进行 android ...
- 关于使用_bstr_t的一个坑
编程中需要将_variant_t转换为char*,常用的方法是:(const char*)_bstr_t(c_variant_t); 使用_bstr_t的构造函数: _bstr_t(const _v ...
- VC++:Debug出错,提示错误在findfile.cpp (Line 369)
调试程序的Debug版本,出现断言框,定位于库文件findfile.cpp 第369行: void CFileFind::AssertValid() const { // if you trip th ...
- error: Allowed memory size
错误提示 error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes) in D:\www\Th ...
- MySQL<添加、更新与删除数据>
添加.更新与删除数据 添加数据 为表中所有字段添加数据 INSERT INTO 表名(字段名1,字段名2,……) VALUES(值1,值2,……); insert into 表名 values(值1, ...
- Linux lspci 命令
PCI(Peripheral Component Interconnect,外设部件互连标准),即定义连接外部设备的一个标准: 主板上有很多 PCI 接口,用来连接显卡.网卡.声卡等外部设备,而 ls ...