Rower Bo

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 650    Accepted Submission(s): 203
Special Judge

Problem Description
There is a river on the Cartesian coordinate system,the river is flowing along the x-axis direction.

Rower Bo is placed at (0,a)

at first.He wants to get to origin (0,0)

by boat.Boat speed relative to water is v1

,and the speed of the water flow is v2

.He will adjust the direction of v1

to origin all the time.

Your task is to calculate how much time he will use to get to origin.Your answer should be rounded to four decimal places.

If he can't arrive origin anyway,print"Infinity"(without quotation marks).

 
Input
There are several test cases. (no more than 1000)

For each test case,there is only one line containing three integers a,v1,v2

.

0≤a≤100

, 0≤v1,v2,≤100

, a,v1,v2

are integers

 
Output
For each test case,print a string or a real number.

If the absolute error between your answer and the standard answer is no more than 10−4

, your solution will be accepted.

 
Sample Input
2 3 3
2 4 3
 
Sample Output
Infinity
1.1428571429
 
Source
 
 
题意 :一个人要坐船过河,从起点(0,a)到终点(0,0),河流和x轴平行,船的速度为v1,水流速度为v2(X轴正方向),要求船的速度的方向一直指向终点(0,0),求船行驶的时间
 
题解:
 
 
 /******************************
code by drizzle
blog: www.cnblogs.com/hsd-/
^ ^ ^ ^
O O
******************************/
//#include<bits/stdc++.h>
#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdio>
#define ll long long
#define mod 1000000007
#define PI acos(-1.0)
using namespace std;
int main()
{
double a,v1,v2;
while(scanf("%lf %lf %lf",&a,&v1,&v2)!=EOF)
{
if(a==)
cout<<"0.00000"<<endl;
else if(v1<=v2)
{
cout<<"Infinity"<<endl;
}
else
{
printf("%.10f\n",a*v1/(v1*v1-v2*v2));
}
}
return ;
}
 

HDU 5761 物理题的更多相关文章

  1. hdu 5761 Rower Bo 物理题

    Rower Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 Description There is a river on the Ca ...

  2. hdu 5066 小球碰撞(物理题)

    http://acm.hdu.edu.cn/showproblem.php?pid=5066 中学物理题 #include <cstdio> #include <cstdlib> ...

  3. [物理题+枚举] hdu 4445 Crazy Tank

    题意: 给你N个炮弹的发射速度,以及炮台高度H和L1,R1,L2,R2. 问任选发射角度.最多能有几个炮弹在不打入L2~R2的情况下打入L1~R1 注意:区间有可能重叠. 思路: 物理题,发现单纯的依 ...

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

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

  5. Bungee Jumping---hdu1155(物理题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1155 题目很长,但是很容易理解,就是人从高s的桥上跳下来,手拉着长为l的绳子末端,如果绳子太短那么人将 ...

  6. 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 ...

  7. HDOJ 1330 Deck(叠木块-物理题啊!贪心算法用到了一点)

    Problem Description A single playing card can be placed on a table, carefully, so that the short edg ...

  8. hdoj 4445 Crazy Tank 物理题/枚举角度1

    Crazy TankTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

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

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

随机推荐

  1. 基于WSAAsyncSelect模型的两台计算机之间的通信

    任务目标 编写Win32程序模拟实现基于WSAAsyncSelect模型的两台计算机之间的通信,要求编程实现服务器端与客户端之间双向数据传递.客户端向服务器端发送"请输出从1到1000内所有 ...

  2. TCL之表达式

  3. Linux相关常用命令

    1.XShell中上传文件命令 首先需要安装rz文件上传工具: yum -y install lrzsz 然后执行以下命令,可打开本地系统的选择文件窗口:(或者直接把本地的文件拖动到SSH Shell ...

  4. P2158 [SDOI2008]仪仗队 欧拉函数模板

    题目描述 作为体育委员,C君负责这次运动会仪仗队的训练.仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是否整齐(如下图 ...

  5. 初见spark-04(高级算子)

    今天,这个是spark的高级算子的讲解的最后一个章节,今天我们来介绍几个简单的算子, countByKey val rdd1 = sc.parallelize(List(("a", ...

  6. 大话CNN经典模型:LeNet

        近几年来,卷积神经网络(Convolutional Neural Networks,简称CNN)在图像识别中取得了非常成功的应用,成为深度学习的一大亮点.CNN发展至今,已经有很多变种,其中有 ...

  7. TouTiao开源项目 分析笔记20 问答详情

    1.效果预览 1.1.效果预览,从问答列表开始 前面实现了从列表到内容. 这里主要讲解从内容到详情. 点击每一个回答内容,进入回答详情页面. 1.2.触发的点击事件 在WendaContentView ...

  8. 3437: 小P的牧场

    3437: 小P的牧场 思路 斜率优化. dp[i]表示到第i个点(第i个点按控制台)的最小代价. 代码 #include<cstdio> #include<iostream> ...

  9. MethodTrace 生成的trace文件为空

    今天我准备生成一个trace文件,看看程序卡在哪里. 一般: Debug.startMethodTracing("yuge"); Debug.stopMethodTracing() ...

  10. ajax跨域请求_url:http://XXX

    利用别的项目提供的一个接口,传入用户名和密码,根据返回的结果判断登陆成功与否. 不经过后台,在js中用ajax实现.对ajax而言,发送跨域请求,与一般写法不同. 如果支持jsonp,则将dataTy ...