题目链接:HDU 5761

题面:

Rower Bo

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 917    Accepted Submission(s): 320
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
2016 Multi-University Training Contest 3

题意:

一艘船从(0,a)点出发,希望到达(0,0)点,其每时每刻都受到水流水平向右的速度v2,以及其本身始终朝向(0,0)点的速度v1,求到达(0,0)点所需时间。

解题:

因为v1有向下的分速度,故肯定会到达x轴,但达到x轴能否到达(0,0)点,是看v1,v2的大小关系,如果v1<=v2,那么是肯定到不了的,输出Infinity,但a=0是特殊情况,直接输出0。队友比赛时写了个模拟程序,奈何精度不够或T,但却为我们猜公式提供了遍历,我们当时是猜出来的.....

【官方题解】

1010 Rower Bo

首先这个题微分方程强解显然是可以的,但是可以发现如果设参比较巧妙就能得到很方便的做法。

先分解v1v​1​​,

设船到原点的距离是rr,容易列出方程

drdt=v2cosθ−v1​dt​​dr​​=v​2​​cosθ−v​1​​

dxdt=v2−v1cosθ​dt​​dx​​=v​2​​−v​1​​cosθ

上下界都是清晰的,定积分一下:

0−a=v2∫0Tcosθdt−v1T0−a=v​2​​∫​0​T​​cosθdt−v​1​​T

0−0=v2T−v1∫0Tcosθdt0−0=v​2​​T−v​1​​∫​0​T​​cosθdt

直接把第一个式子代到第二个里面

v2T=v1v2(−a+v1T)v​2​​T=​v​2​​​​v​1​​​​(−a+v​1​​T)

T=v1av12−v22T=​v​1​​​2​​−v​2​​​2​​​​v​1​​a​​

这样就很Simple地解完了,到达不了的情况就是v1<v2v​1​​<v​2​​(或者a>0a>0且v1=v2v​1​​=v​2​​)。

HDU 5761 Rower Bo(积分)相关推荐

  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 5761 Rower Bo

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

  3. HDU 5761 Rower Bo 物理题(积分求时间)

    点击打开链接 题意: 有一个船在(0,a),船头的方向一直指着(0,0)位置,速度是v1,然后有一个水流速度是v2,朝着x轴正半轴方向流. 问你什么时候船到达(0,0)位置 题解: 首先这个题微分方程 ...

  4. 【数学】HDU 5761 Rower Bo

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

  5. HDU - 5761 Rower Bo (非常详细的解答,有轨迹图)

    题意分析: 在直角坐标系中,小船起点在(0, a)位置,终点在 (0, 0)位置,小船相对于 静水的速度是 V1 , 水流速度是 V2 (方向同 X 轴正方向 ). 行船过程中,V1 的方向一直朝向终 ...

  6. HDU 5761 Rower Bo(物理)

    Description 沿着x轴有一条从左向右流且流速为v2的小河,有一艘位于(0,a)处,相对于水速速度为v1的小船,小船时刻调整其船头使之朝向(0,0)处,问小船到达(0,0)点所需的最短时间 I ...

  7. 【HDU】5761 Rower Bo

    Rower Bo 题目链接 Rower Bo 题目大意 现在坐标系上有一条小船,在(0,a),现在这条小船从该点驶向原点,小船的速度为v1,水流的速度为v2:小船的速度方向始终指向原点,水流的方向始终 ...

  8. HDU 5761 多校联合 Rower BO

    题目链接:HDU5761 Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/ ...

  9. 2016 Multi-University Training Contest 3 1010 Rower Bo

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

最新文章

  1. Python标准库threading模块Condition原理浅析
  2. docker-Consul的概述及consul集群环境的搭建
  3. html比赛项目,趣味运动会最新个人比赛项目
  4. 度微尔开发者联盟网站
  5. 【腾讯优测干货分享】使用多张图片做帧动画的性能优化
  6. 今天我才明白了泛型,泛型类 泛型方法
  7. 大学计算机专业的实验室图片,清华大学计算机系人工智能实验室.PDF
  8. JS获取url参数,主域名等方法
  9. 黑马程序员 HTTP协议简介
  10. Android面试问题收集总结
  11. Windows and CentOS IPv4转IPv6隧道方法
  12. HBase:HBase的rowKey设计技巧
  13. <C++>运算符重载完结,详解赋值,关系,函数调用运算符
  14. 关于冯.诺依曼结构与哈佛结构的一些疑问
  15. HSQLDB数据库使用详解(入门)及快速使用
  16. ubuntu折腾笔记【三】
  17. 笑死:Welcome to Skip Thompson's Homepage
  18. 程序报错:AttributeError: module ‘cv2.cv2‘ has no attribute ‘cv2.MultiTracker_create()‘
  19. 对话框js插件源码汇总
  20. llowpoly风格人物模型(含骨骼动作提供下载)

热门文章

  1. 开发日志:浏览器宽度大于400px,td的宽度按百分比自适应,小于400px时,宽度为指定的值
  2. 计算个人所得税(老版)​​​​​​​
  3. Noise-contrastive Estimation(NCE)学习
  4. 【往届会议已EI检索】第六届管理工程、软件工程与服务科学国际会议
  5. c ajax 500,Ajax和jQuery中的C:\ fakepath \ *。*
  6. ImageMagick将多张图片拼接成一张图片_如何将多张图片排列在一张图片呢?学会这两种技巧,轻松搞定...
  7. 对C语言中警告(warning)的处理方法
  8. vot-toolkit-python测试DiMP50在VOT2018上的表现
  9. Matlab 元胞自动机(模拟传染病传播)
  10. xpath 准确匹配 跟 模糊匹配属性