题目链接:

Rower Bo

Time Limit: 2000/1000 MS (Java/Others)   

 Memory Limit: 131072/131072 K (Java/Others)

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
题意:
给小船的初始位置,水的流速,小船相对于水的速度;现在小船每刻的方向都朝向原点,问小船到达原点的用时是多少;
思路:
我太笨了,当时比赛的时候就不会做;后来看的题解;
http://bestcoder.hdu.edu.cn/blog/2016-multi-university-training-contest-3-solutions-by-%E7%BB%8D%E5%85%B4%E4%B8%80%E4%B8%AD/
AC代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
//#include <bits/stdc++.h>
#include <stack>using namespace std;#define For(i,j,n) for(int i=j;i<=n;i++)
#define mst(ss,b) memset(ss,b,sizeof(ss));typedef  long long LL;template<class T> void read(T&num) {char CH; bool F=false;for(CH=getchar();CH<'0'||CH>'9';F= CH=='-',CH=getchar());for(num=0;CH>='0'&&CH<='9';num=num*10+CH-'0',CH=getchar());F && (num=-num);
}
int stk[70], tp;
template<class T> inline void print(T p) {if(!p) { puts("0"); return; }while(p) stk[++ tp] = p%10, p/=10;while(tp) putchar(stk[tp--] + '0');putchar('\n');
}const LL mod=1e9+7;
const double PI=acos(-1.0);
const int inf=1e9;
const int N=2e6+10;
const int maxn=500+10;
const double eps=1e-8;int main()
{       double a,v1,v2;while(scanf("%lf%lf%lf",&a,&v1,&v2)!=EOF){if(v1<=v2){if(v1<=v2&&a>0)printf("Infinity\n");else printf("0\n");}else {printf("%.6lf\n",1.0*v1*a/(v1*v1-v2*v2));}}return 0;
}

  

转载于:https://www.cnblogs.com/zhangchengc919/p/5709035.html

hdu-5761 Rower Bo(数学)相关推荐

  1. HDU 5761 Rower Bo(积分)

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

  2. hdu 5761 Rower Bo 物理题

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

  3. HDU 5761 Rower Bo

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

  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 物理题(积分求时间)

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

  8. 【HDU】5761 Rower Bo

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

  9. HDU 5761 多校联合 Rower BO

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

最新文章

  1. “嫦娥上月球挖土”!打破尘封44年的人类历史,中国航天实现“五个首次”...
  2. 苹果天气不显示_iPhone6开机不显示苹果售后维修案例
  3. 浅谈Mybatis的一级缓存和二级缓存
  4. 真实经历:整整一年了,他是这样从程序员转型做产品经理的
  5. sonyflake.go
  6. 两个文件比较之comm命令
  7. 占用系统资源测试_高频性能测试面试题15道
  8. 收藏 | 深度学习检测小目标常用方法
  9. Java 并发编程AQS基本介绍
  10. JAVA继承类phone_【Java基础】类-----继承
  11. Emacs里一些古老的术语
  12. 理想的正方形 HAOI2007(二维RMQ)
  13. Python一些很实用的知识
  14. C/C++ 控制台输入
  15. Atitit 提升效率 声明式编程 约束式编程 目录 1. 。 在约束编程中,问题被视为对可能是有效解决方案的一系列限制。 1 2. 常见的约束式编程 2 2.1. 数据库约束 注解 2 2.2.
  16. 工业级Pass云平台SpringCloudAlibaba综合项目实战(二):解决方案和工作效率
  17. 阿里巴巴国际站店铺装修悬浮菜单定位,快速导航链接到某个位置,跳转链接悬浮代码工具代码生成器制作锚点链接
  18. C# 批量图片打包下载
  19. 工具及方法 - 编辑二进制文件(使用VSCode和Notepad++的插件Hex Editor)
  20. Python视频图像播放中加入文字

热门文章

  1. python -flask简介
  2. 7-5 计算个人所得税 (20分)
  3. YTU OJ 3094: 善良的小乌龟
  4. Socket在iOS客户端上的简单实现 - 利用GCAsyncSocket框架
  5. Authing 实践|制造业身份认证统一管理解决方案
  6. 微信小程序云开发———CMS
  7. 红外额温枪方案开发技术支持
  8. Vue报错:implicitly has an ‘any‘ type解决方法
  9. IOS中__bridge,__bridge_retained和__bridge_transfer理解
  10. 以DA方式通过opcdaauto.dll访问opc服务器异步操作异常0x80040200问题