题目链接:

  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

  1. //
  2. //by coolxxx
  3. //
  4. #include<iostream>
  5. #include<algorithm>
  6. #include<string>
  7. #include<iomanip>
  8. #include<memory.h>
  9. #include<time.h>
  10. #include<stdio.h>
  11. #include<stdlib.h>
  12. #include<string.h>
  13. //#include<stdbool.h>
  14. #include<math.h>
  15. #define min(a,b) ((a)<(b)?(a):(b))
  16. #define max(a,b) ((a)>(b)?(a):(b))
  17. #define abs(a) ((a)>0?(a):(-(a)))
  18. #define lowbit(a) (a&(-a))
  19. #define sqr(a) ((a)*(a))
  20. #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
  21. #define eps (1e-8)
  22. #define J 10000000
  23. #define MAX 0x7f7f7f7f
  24. #define PI 3.1415926535897
  25. #define N 1004
  26. using namespace std;
  27. typedef long long LL;
  28. int cas,cass;
  29. int n,m,lll,ans;
  30. int v1,v2;
  31. int main()
  32. {
  33. #ifndef ONLINE_JUDGE
  34. // freopen("1.txt","r",stdin);
  35. // freopen("2.txt","w",stdout);
  36. #endif
  37. int i,j;
  38. // for(scanf("%d",&cas);cas;cas--)
  39. // for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
  40. // while(~scanf("%s",s))
  41. while(~scanf("%d",&n))
  42. {
  43. scanf("%d%d",&v1,&v2);
  44. if(n==)puts("0.000000");
  45. else if(v1<=v2)puts("Infinity");
  46. else printf("%lf\n",double(n*v1)/(sqr(v1)-sqr(v2)));
  47. }
  48. return ;
  49. }
  50. /*
  51. //
  52.  
  53. //
  54. */

【数学】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 Jud ...

  3. hdu 5761 Rower Bo 微分方程

    Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total ...

  4. hdu 5761 Rowe Bo 微分方程

    1010 Rower Bo 首先这个题微分方程强解显然是可以的,但是可以发现如果设参比较巧妙就能得到很方便的做法. 先分解v_1v​1​​, 设船到原点的距离是rr,容易列出方程 \frac{ dr} ...

  5. hdu-5761 Rower Bo(数学)

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

  6. HDU 5761 物理题

    Rower Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total ...

  7. 【数学】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为真则为 ...

  8. HDU 5752 Sqrt Bo (数论)

    Sqrt Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...

  9. HDU 5753 Permutation Bo (推导 or 打表找规律)

    Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...

随机推荐

  1. [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 ...

  2. gridview添加header

    gridview是不能添加header的,这里的解决方法是将listview改造成gridview使用,功能很好用,唯一的缺点是列数不能自适应 示例代码下载地址http://pan.baidu.com ...

  3. JFreeChart当鼠标停留在热点提示自定义信息功能

    当鼠标停留在数据点时,希望有提示信息显示,但是根据业务需要,我们需要自定义显示一下信息!具体功能实现如下: 首先我们要弄明白,Jfreechart鼠标提示信息显示主要是得到一个数据的map对象,该ma ...

  4. python之路,Day24 常用设计模式学习

    python之路,Day24 常用设计模式学习   本节内容 设计模式介绍 设计模式分类 设计模式6大原则 1.设计模式介绍 设计模式(Design Patterns) --可复用面向对象软件的基础 ...

  5. codevs1002搭桥(建图+Prim)

    /* 先来个灌水法 然后建图跑最小生成树 注意观察题目中的规则 a[1][i]!=a[1][j]&&abs(a[2][i]-a[2][j])<=1 建图的时候可以每一个建筑物都看 ...

  6. Linq101-Ordering

    using System; using System.Collections.Generic; using System.Linq; namespace Linq101 { class Orderin ...

  7. (转)PHP函数spl_autoload_register()用法和__autoload()介绍

      转--http://www.jb51.net/article/29624.htm 又是框架冲突导致__autoload()失效,用spl_autoload_register()重构一下,问题解决 ...

  8. Android - Layout时发生'Unfortunately xxx has stopped'

    概述 我在进行LinearLayout和TableLayout的嵌套布局的时候,发生题的错误.如下布局xml代码: <LinearLayout xmlns:android="http: ...

  9. Sqlite 错误码

    #define SQLITE_OK 0 /* 成功 | Successful result */ /* 错误码开始 */ #define SQLITE_ERROR 1 /* SQL错误 或 丢失数据库 ...

  10. 了解<hx>标签,为你的网页添加标题

    文章的段落用<p>标签,那么文章的标题用什么标签呢?在本节我们将使用<hx>标签来制作文章的标题.标题标签一共有6个,h1.h2.h3.h4.h5.h6分别为一级标题.二级标题 ...