【数学】HDU 5761 Rower Bo
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=5761
题目大意:
船在(0,a),船速v1,水速v2沿x轴正向,船头始终指向(0,0),问到达(0,0)用时,无解输出Infinity。
题目思路:
【数学】
说是数学其实更像物理。
很明显v1<=v2时无解。
这道题列积分方程然后解出来式子是t=a*v1/(v12-v22).
我列积分方程的时候少了一个式子没解出来。
可以看看半根毛线的。http://images2015.cnblogs.com/blog/786945/201607/786945-20160727001007169-1245551033.png
- //
- //by coolxxx
- //
- #include<iostream>
- #include<algorithm>
- #include<string>
- #include<iomanip>
- #include<memory.h>
- #include<time.h>
- #include<stdio.h>
- #include<stdlib.h>
- #include<string.h>
- //#include<stdbool.h>
- #include<math.h>
- #define min(a,b) ((a)<(b)?(a):(b))
- #define max(a,b) ((a)>(b)?(a):(b))
- #define abs(a) ((a)>0?(a):(-(a)))
- #define lowbit(a) (a&(-a))
- #define sqr(a) ((a)*(a))
- #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
- #define eps (1e-8)
- #define J 10000000
- #define MAX 0x7f7f7f7f
- #define PI 3.1415926535897
- #define N 1004
- using namespace std;
- typedef long long LL;
- int cas,cass;
- int n,m,lll,ans;
- int v1,v2;
- int main()
- {
- #ifndef ONLINE_JUDGE
- // freopen("1.txt","r",stdin);
- // freopen("2.txt","w",stdout);
- #endif
- int i,j;
- // for(scanf("%d",&cas);cas;cas--)
- // for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
- // while(~scanf("%s",s))
- while(~scanf("%d",&n))
- {
- scanf("%d%d",&v1,&v2);
- if(n==)puts("0.000000");
- else if(v1<=v2)puts("Infinity");
- else printf("%lf\n",double(n*v1)/(sqr(v1)-sqr(v2)));
- }
- return ;
- }
- /*
- //
- //
- */
【数学】HDU 5761 Rower Bo的更多相关文章
- hdu 5761 Rower Bo 物理题
Rower Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5761 Description There is a river on the Ca ...
- 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 Rowe Bo 微分方程
1010 Rower Bo 首先这个题微分方程强解显然是可以的,但是可以发现如果设参比较巧妙就能得到很方便的做法. 先分解v_1v1, 设船到原点的距离是rr,容易列出方程 \frac{ dr} ...
- hdu-5761 Rower Bo(数学)
题目链接: Rower Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others ...
- HDU 5761 物理题
Rower Bo Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total ...
- 【数学】HDU 5753 Permutation Bo
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 题目大意: 两个序列h和c,h为1~n的乱序.h[0]=h[n+1]=0,[A]表示A为真则为 ...
- HDU 5752 Sqrt Bo (数论)
Sqrt Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...
- HDU 5753 Permutation Bo (推导 or 打表找规律)
Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...
随机推荐
- [Javascript] Intro to the Web Audio API
An introduction to the Web Audio API. In this lesson, we cover creating an audio context and an osci ...
- gridview添加header
gridview是不能添加header的,这里的解决方法是将listview改造成gridview使用,功能很好用,唯一的缺点是列数不能自适应 示例代码下载地址http://pan.baidu.com ...
- JFreeChart当鼠标停留在热点提示自定义信息功能
当鼠标停留在数据点时,希望有提示信息显示,但是根据业务需要,我们需要自定义显示一下信息!具体功能实现如下: 首先我们要弄明白,Jfreechart鼠标提示信息显示主要是得到一个数据的map对象,该ma ...
- python之路,Day24 常用设计模式学习
python之路,Day24 常用设计模式学习 本节内容 设计模式介绍 设计模式分类 设计模式6大原则 1.设计模式介绍 设计模式(Design Patterns) --可复用面向对象软件的基础 ...
- codevs1002搭桥(建图+Prim)
/* 先来个灌水法 然后建图跑最小生成树 注意观察题目中的规则 a[1][i]!=a[1][j]&&abs(a[2][i]-a[2][j])<=1 建图的时候可以每一个建筑物都看 ...
- Linq101-Ordering
using System; using System.Collections.Generic; using System.Linq; namespace Linq101 { class Orderin ...
- (转)PHP函数spl_autoload_register()用法和__autoload()介绍
转--http://www.jb51.net/article/29624.htm 又是框架冲突导致__autoload()失效,用spl_autoload_register()重构一下,问题解决 ...
- Android - Layout时发生'Unfortunately xxx has stopped'
概述 我在进行LinearLayout和TableLayout的嵌套布局的时候,发生题的错误.如下布局xml代码: <LinearLayout xmlns:android="http: ...
- Sqlite 错误码
#define SQLITE_OK 0 /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 ...
- 了解<hx>标签,为你的网页添加标题
文章的段落用<p>标签,那么文章的标题用什么标签呢?在本节我们将使用<hx>标签来制作文章的标题.标题标签一共有6个,h1.h2.h3.h4.h5.h6分别为一级标题.二级标题 ...