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 ...
随机推荐
- Unity简介
Unity (也称 nity3D) 是一套包括图形. 声音.物理等功能的游戏引擎,提供了一个强大的关卡编辑器,支持大部分主流 3D 软件格式,使用 C# JavaScript 等高级语言实现脚本功能, ...
- 获取用户真实的IP
在实际项目很使用的函数,果断收集了 function get_client_ip() { if (getenv("HTTP_CLIENT_IP") && str ...
- ini 文件操作记要(2): 使用 TMemIniFile
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Form ...
- jquery把int类型转换成字符串类型的方法
jQuery中把获取的number类型数据转换成字符串类型 var val=$(“#id).val(); If(typeof val==”number”){ val+=' '; }
- 怎么用MathType编辑带圈字母
在用word公式编辑器MathType编辑公式时,里面涉及到很多的数学物理符号等等,这些符号或者是公式其实都可以利用MathType中的模板进行组合.在这些数学公式中,有时会有一些比较特殊的符号,它们 ...
- Java精选笔记_Java编程基础
Java的基本语法 Java代码的基本格式 修饰符 class 类名 { 程序代码 } 一个Java源文件只定义一个类,不同的类使用不同的源文件定义:将每个源文件中单独定义的类都定义成public ...
- C语言的基本构成
C语言的基本构成 知识点:C语言的注释:关键字:书写风格:常量和变量 重要程度:★★★★ 1.C语言的良好风格 用C语言编写的程序,称为C语言源程序,简称C程序. 本节将通过一个简单的C程序例子,向大 ...
- Win8/8.1下驱动安装“数据无效”错误的有效解决方法
Windows8.1 安装完vmware 后并没有安装 vmnet1,vmnet8 这两个虚拟网卡,纠结了半天,原来是两个服务没打开. 如果你使用的是Windows8或者8.1,并且精简过系统,那么在 ...
- ATL字符宏使用以及代码测试
// ATL_Convert.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> #incl ...
- cocos2dx游戏--欢欢英雄传说--添加触摸响应
主要的调整就是将HelloWorldScene改成了MainSecne,然后将Player作为了MainScene的私有成员变量来处理.修改了人物图片,使用了网上找到的三国战纪的人物素材代替我之前画的 ...