Rower Bo

题目连接:

http://acm.hdu.edu.cn/showproblem.php?pid=5761

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

Hint

题意

有一个船在(0,a),船头的方向一直指着(0,0)位置,速度是v1,然后有一个水流速度是v2,朝着x轴正半轴方向流。

问你什么时候船到达(0,0)位置。

题解:

傻逼物理题,高中考了无数遍,嘿嘿嘿。

程书习题2-29 狐狸追猎犬

解释是我百度的:

有一只狐狸以不变速度v1沿着直线AB逃跑,一猎犬以不变的速率v2追击,其运动方向始终对准狐狸。某时刻狐狸在F处,猎犬在D处,FD⊥L(如图)

设运动时间为t,任意时刻ti对应一个v2与竖直方向所成的α角度

若追上

则在水平方向上:∫<0,t> v2sinα dt=v1t………………③

在竖直方向上:∫<0,t>v2cosα dt=L…………………④

尽管列出这两个方程,我们仍有一个条件没有用到,那就是猎犬速度方向始终朝向狐狸。于是我们想到了相对运动

若以狐狸建立参考系,则猎犬在一个直线运动,其路程即为L。由于有

v绝对=v相对+v牵连

所以 猎犬对狐狸在每个时刻的相对速度 v’=v2-v1sinα

如此便有 ∫<0,t> v'dt=L

即 ∫<0,t> v2dt-∫<0,t> v1sinα dt=L………………⑤

联立③和⑤,即可得到t= v2L/(v22-v12)

代码

#include<bits/stdc++.h>
using namespace std;
double a,v1,v2;
void solve(){
if(a==0){
double ans = 0;
printf("%.12f\n",ans);
return;
}
if(v1<=v2){
printf("Infinity\n");
return;
}
printf("%.12f\n",a*v1/(v1*v1-v2*v2));
}
int main(){
while(cin>>a>>v1>>v2)solve();
return 0;
}

hdu 5761 Rower Bo 物理题的更多相关文章

  1. HDU 5761 Rower Bo

    传送门 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Special Jud ...

  2. hdu 5761 Rower Bo 微分方程

    Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total ...

  3. 【数学】HDU 5761 Rower Bo

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 题目大意: 船在(0,a),船速v1,水速v2沿x轴正向,船头始终指向(0,0),问到达(0, ...

  4. hdu 5761 Rowe Bo 微分方程

    1010 Rower Bo 首先这个题微分方程强解显然是可以的,但是可以发现如果设参比较巧妙就能得到很方便的做法. 先分解v_1v​1​​, 设船到原点的距离是rr,容易列出方程 \frac{ dr} ...

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

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

  6. hdu 5753 Permutation Bo 水题

    Permutation Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...

  7. hdu 5752 Sqrt Bo 水题

    Sqrt Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...

  8. HDU 5752 Sqrt Bo (思维题) 2016杭电多校联合第三场

    题目:传送门. 题意:一个很大的数n,最多开5次根号,问开几次根号可以得到1,如果5次还不能得到1就输出TAT. 题解:打表题,x1=1,x2=(x1+1)*(x1+1)-1,以此类推.x5是不超过l ...

  9. HDU 5761 物理题

    Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total ...

随机推荐

  1. 转 -----那些年总也记不牢的IO

    关于资源关闭: 一般情况下是:先打开的后关闭,后打开的先关闭 另一种情况:看依赖关系,如果流a依赖流b,应该先关闭流a,再关闭流b 例如处理流a依赖节点流b,应该先关闭处理流a,再关闭节点流b 当然完 ...

  2. Jquery教你写一个简单的轮播.

    这个我表示写的不咋地-_-//,但是胜在简单,可优化性不错. 实际上我本来想写个复杂点的结构的,但是最近忙成狗了!!!!所以大家就讲究着看吧 HTML结构 <div class="ba ...

  3. Flex 笔记整理 三

    1. Panel, TitleWindow PopUpManager 透明 用一个类,这个类里引用一个组件, P如 Panel, TitleWindow等, 利用PopUpManager来弹出显示.  ...

  4. iOS 中nil,Nil,NULL,NSNull的区别

    类与对象的概念 类是对同一类事物高度的抽象,类中定义了这一类对象所应具有的静态属性(属性)和动态属性(方法). 对象是类的一个实例,是一个具体的事物. 类与对象是抽象与具体的关系. 类其实就是一种数据 ...

  5. HDU 4712 Hamming Distance(随机算法)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4712 解题报告:输入n个数,用十六进制的方式输入的,任意选择其中的两个数进行异或,求异或后的数用二进制 ...

  6. 02 uni-app框架学习:设置全局样式统一每个页面的背景颜色

    1.设置全局样式可以在App.vue里面 2.在每个页面的根view 里添加一个class名叫page

  7. [转]GCC系列: __attribute__((visibility("")))

    在 objc-api.h 里面有很多关于__attribute__ 的定义. 例如 #if !defined(OBJC_VISIBLE) # if TARGET_OS_WIN32 # if defin ...

  8. CentOS安装SVN客户端

    1.检查系统是否已经安装如果安装就卸载 rpm -qa subversion yum remove subversion 2.安装 yum install subversion 3.建立SVN库 mk ...

  9. python实现广度优先搜索和深度优先搜索

    图的概念 图表示的是多点之间的连接关系,由节点和边组成.类型分为有向图,无向图,加权图等,任何问题只要能抽象为图,那么就可以应用相应的图算法. 用字典来表示图 这里我们以有向图举例,有向图的邻居节点是 ...

  10. MCM/ICM2018美国大学生数学建模大赛D题翻译

    MCM/ICM2018美国大学生数学建模大赛D题翻译 2018年ICM问题D: 非使用汽油并在使用电力行驶的汽车(电量非空的) 由于环境和经济的原因,全球都在减少使用化石燃料,包括汽车汽油. 无论是受 ...