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. 考研:操作系统:进程同步—信号量实现同步互斥(PV操作)

    进程互斥的硬件实现方法

  2. Spring: 读取 .properties 文件地址,json转java对象,el使用java类方法相关 (十三)

    1. 在Java中获取 .properties 文件的路径 (src/main/resources 下) ProjectName |---src/main/java |---src/main/reso ...

  3. 第10月第6天 lua 闭包

    1. static int mytest(lua_State *L) { //获取上值 )); printf("%d\n", upv); upv += ; lua_pushinte ...

  4. HDU 2049 不容易系列之(4)——考新郎 (错排+组合)

    题目链接. Problem Description 国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体 ...

  5. [USACO08DEC]Trick or Treat on the Farm 记忆化搜索

    这一题非常水,因为每个点的下一个目的地是唯一的,可以考虑对每一个还为访问过的点dfs直接找出所有的环,同时更新每一个点能去的点的数量(即答案). 我们dfs时找到环上已经遍历过的一个点,用当前的dfn ...

  6. Jmeter如何保持cookie,让所有请求都能用同一个cookie,免去提取JSESSIONID

    近期有柠檬班的学生找到华华,问了一个问题,就是利用Jmeter做接口测试的时候,如何提取头部的JSESSIONID然后传递到下一个请求,继续完成当前用户的请求. 其实,关于这个问题有三种种解决方法: ...

  7. C - Segments POJ - 3304 (判断线段相交)

    题目链接:https://vjudge.net/contest/276358#problem/C 题目大意:给你n条线段,问你是否存在一条线段使得所有的线段在这条直线的投影至少具有一个交点? 具体思路 ...

  8. Javascript - Vue - 过滤器

    过滤器 输出的数据由vue对象提供,但它的数据可能需要做进一步的处理才适合展示给用户看,为此,可以在静态的Vue上定义一个过滤器对实例vue对象的data数据进行过滤处理. //调用过滤器//msg是 ...

  9. spring-boot-mybatis-多数据源

    sql 语句 DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) NOT NULL AUTO_INCREMENT ...

  10. RabbitMQ集群下队列存放消息的问题

    RabbitMQ中队列有两种模式 1.默认 Default 2.镜像 Mirror [类似于mongoDB,从一直在通过主的操作日志来进行同步] *如果将队列定义为镜像模式,那么这个队列也将区分主从, ...