hdu 5761 Rower Bo 物理题
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 物理题的更多相关文章
- HDU 5761 Rower Bo
传送门 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Special Jud ...
- hdu 5761 Rower Bo 微分方程
Rower Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
- 【数学】HDU 5761 Rower Bo
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 题目大意: 船在(0,a),船速v1,水速v2沿x轴正向,船头始终指向(0,0),问到达(0, ...
- hdu 5761 Rowe Bo 微分方程
1010 Rower Bo 首先这个题微分方程强解显然是可以的,但是可以发现如果设参比较巧妙就能得到很方便的做法. 先分解v_1v1, 设船到原点的距离是rr,容易列出方程 \frac{ dr} ...
- hdu 5066 小球碰撞(物理题)
http://acm.hdu.edu.cn/showproblem.php?pid=5066 中学物理题 #include <cstdio> #include <cstdlib> ...
- hdu 5753 Permutation Bo 水题
Permutation Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...
- hdu 5752 Sqrt Bo 水题
Sqrt Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...
- HDU 5752 Sqrt Bo (思维题) 2016杭电多校联合第三场
题目:传送门. 题意:一个很大的数n,最多开5次根号,问开几次根号可以得到1,如果5次还不能得到1就输出TAT. 题解:打表题,x1=1,x2=(x1+1)*(x1+1)-1,以此类推.x5是不超过l ...
- HDU 5761 物理题
Rower Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
随机推荐
- Nginx学习总结
2017年2月23日, 星期四 Nginx学习总结 Nginx是目前比较主流的HTTP反向代理服务器(其企业版提供了基于TCP层的反向代理插件),对于构建大型分布式web应用,具有举足轻重的作用.简单 ...
- AngularJs -- 指令简介
整理书籍内容(QQ:283125476 发布者:M [重在分享,有建议请联系->QQ号]) HTML文档 HTML文档是一个纯文本文件,包含了页面的结构以及由CSS定义的样式,或者可以操作样式的 ...
- BZOJ1009 GT考试
1009: [HNOI2008]GT考试 Time Limit: 1 Sec Memory Limit: 162 MB Description 阿申准备报名参加GT考试,准考证号为N位数X1X2.. ...
- C++--------------------------------指针和数组替换使用原因
马上要考试了,复习数据结构中,对C的指针不太了解,在严蔚敏<数据结构(C语言版)>中,发现p22定义顺序存储结构: typedef srtuct{ ElemType *elem; //存储 ...
- vue需要注意的事宜
1.Vue在进行点击事件的时候大部分是在标签上进行添加的,一般在标签上添加@click: 如果需要在组件上面进行点击事件的时候,直接写@click是木有变化的,需要在后面添加一个.native就如@c ...
- Django之初始庐山真面目
Django可以说是基于Python语言的一款非常成熟的框架,其功能之强大,应用之广泛,开发之便捷,可以说每一个细节都值得一赞 最重要的是,Django其实是我们学习Python过程中非常重要的部分之 ...
- 转载 你不知道的super
http://funhacks.net/2016/11/09/super/ super仅被用于新式类 在类的继承中,如果重定义某个方法,该方法会覆盖父类的同名方法,但有时,我们希望能同时实现父类的功能 ...
- Windows中用“ls”命令
解决办法是: 在C:\Windows\System32目录下新建文本文档,文件内容为: @echo off dir 另存为“ls.bat” 类型为所有文件,编码ANSI 可使用dir 或者ls都可以 ...
- 关于Hadoop未授权访问可导致数据泄露通知
尊敬的腾讯云客户: 您好!近日,外部媒体报道全球Hadoop服务器因配置不安全导致海量数据泄露,涉及使用Hadoop分布式文件系统(HDFS)的近4500台服务器,数据量高达5120 TB (5.12 ...
- rtop:一个通过 SSH 监控远程主机的交互式工具【转】
编译自: http://www.tecmint.com/rtop-monitor-remote-linux-server-over-ssh/ rtop[1] 是一个基于 SSH 的直接的交互式远程系统 ...