1010 Rower Bo

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

先分解v_1v​1​​,

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

\frac{ dr}{ dt}=v_2\cos \theta-v_1​dt​​dr​​=v​2​​cosθ−v​1​​

\frac{ dx}{ dt}=v_2-v_1\cos \theta​dt​​dx​​=v​2​​−v​1​​cosθ

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

0-a=v_2\int_0^T\cos\theta{ d}t-v_1T0−a=v​2​​∫​0​T​​cosθdt−v​1​​T

0-0=v_2T-v_1\int_0^T\cos\theta{ d}t0−0=v​2​​T−v​1​​∫​0​T​​cosθdt

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

v_2T=\frac{v_1}{v_2}(-a+v_1T)v​2​​T=​v​2​​​​v​1​​​​(−a+v​1​​T)

T=\frac{v_1a}{{v_1}^2-{v_2}^2}T=​v​1​​​2​​−v​2​​​2​​​​v​1​​a​​

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

1011 Teacher Bo

考虑一种暴力,每次枚举两两点对之间的曼哈顿距离,并开一个桶记录每种距离是否出现过,如果某次枚举出现了以前出现的距离就输 YESYES ,否则就输 NONO .

注意到曼哈顿距离只有 O(M)O(M) 种,根据鸽笼原理,上面的算法在 O(M)O(M) 步之内一定会停止.所以是可以过得.

一组数据的时间复杂度 O(\min{N^2,M})O(min{N​2​​,M}) .

Rower Bo

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 1248    Accepted Submission(s): 474
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
 
Author
绍兴一中
 
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main()
{
int a,v1,v2;
while(~scanf("%d%d%d",&a,&v1,&v2))
{
if(a==) {printf("0.000\n");continue;}
if(v1<=v2)
{
printf("Infinity\n");
}
else
{
double v=(v1*v1-v2*v2)+0.0; double ans=(a*v1*1.0)/v;
printf("%.12lf\n",ans);
}
}
return ;
}

hdu 5761 Rowe Bo 微分方程的更多相关文章

  1. hdu 5761 Rower Bo 微分方程

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

  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 Jud ...

  4. 【数学】HDU 5761 Rower Bo

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

  5. HDU 5752 Sqrt Bo (数论)

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

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

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

  7. HDU 5762 Teacher Bo (暴力)

    Teacher Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5762 Description Teacher BoBo is a geogra ...

  8. HDU 5752 Sqrt Bo【枚举,大水题】

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

  9. hdu 5762 Teacher Bo 暴力

    Teacher Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5762 Description Teacher BoBo is a geogra ...

随机推荐

  1. 【原创】ui.router源码解析

    Angular系列文章之angular路由 路由(route),几乎所有的MVC(VM)框架都应该具有的特性,因为它是前端构建单页面应用(SPA)必不可少的组成部分. 那么,对于angular而言,它 ...

  2. Javascript网页摇一摇

    function init(){ if (window.DeviceMotionEvent) { // 移动浏览器支持运动传感事件 window.addEventListener('devicemot ...

  3. [原] Android持续优化 - 提高流畅度

    一.形象的感官一下流畅度概念 1. 这是官方给出的概念:Android流畅运行,需要运行60帧/秒, 则需要每帧的处理时间不超过16ms. 2. 每秒帧数,实际上就是指动画或视频每秒放映的画面数.因此 ...

  4. 登录DA面板出现:License has expired

    登录DA面板出现:License has expired的解决方法. 首先看是否过期,如果出现The license looks fine on this end. 登录 SSH as root # ...

  5. alipay iOS SDK

    我也是醉了,进支付宝主页找都找不到,好不容易找到赶紧记下来:https://b.alipay.com/order/productDetail.htm?productId=201308060460965 ...

  6. UISerachBar / UISearchDisplayController

    1. UISerachBar 继承与UIView, 包含uitextfield, 并且实现了uitextfielddelegate代理的主要内容 含有取消按钮, 默认不显示 2. UISerachDi ...

  7. reverse array java

    /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import ...

  8. [ES4封装教程]3.使用 Easy Sysprep v4 封装 Windows 7

    (一)安装与备份系统 1.安装 Windows 7 可能很多人会说,安装Win7谁不会,这也用说?装Win7的确人人都会,但如何安装才是最适合系统封装的,就未必是人人都会了.安装是封装之本,没有好的安 ...

  9. qq空间答案

    2073693795 懂得人自然会懂

  10. QEMU 使用的镜像文件:qcow2 与 raw

    qcow2 的基本原理 qcow2 镜像格式是 QEMU 模拟器支持的一种磁盘镜像.它也是可以用一个文件的形式来表示一块固定大小的块设备磁盘.与普通的 raw 格式的镜像相比,有以下特性: 更小的空间 ...