Prototype


Time Limit: 1 Second      Memory Limit: 32768 KB

Prototype is a 3D game which allow you to control a person named Alex with much super ability to finish missions with gut along. Alex has the abilitiy to glide in the sky. What's more, he can make at most 3-level glide, which means before he lands at the ground, he has two chances to adjust and perform another glide. We assume that each time he perform a glide, his vertical speed become zero and glide forward with a new speed. And the orbit will be a parabola due to the gravity.

To make the problem easier, we now only consider at most 2-level glide. The binomial coefficient of the mathematical equation of the fist glide will be given as -a and the second will be -b, which means the formulations are (y - y0) = -ax2 and (y - y0) = -b(x - x0)2. As the picture above, Alex perform a glide from the top of Building1, make a 1-level or a 2-level glide and lands exactly at point B. What's more, there is Building2 standing between Building1 and point B. Alex has to avoid crashing onto it.

Input

There are no more than 15 cases. Proceed till the end of file.
Each case contains only one line of six real number h1,
h2, d1, d2, a,
b. h1 is the height of Building1,
h2 is the height of Building2, d1 is the
X-distance between Building1 and Building2, d2 is the
X-distance between point B and Building1. These four numbers are in [0, 1000]
, and satisfies d1 < d2. And a and b are in
(0, 1000].

Output

If it is possible for Alex to land exactly on point B, print Yes, otherwise
print No.

Sample Input

25 1 6 7 1 1
4 3 1 2 1 1

Sample Output

Yes
Yes

HINT

In case 2, Alex just glide over the building2 and do not crash onto it.

 #include<iostream>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std; int main()
{
double h1,h2,d1,d2,a,b,x[];
while (scanf("%lf%lf%lf%lf%lf%lf",&h1,&h2,&d1,&d2,&a,&b)!=EOF)
{
if (h1/b-d2*d2>)
{
printf("No\n");
continue;
}
double derta=*b*b*d2*d2-*(a+b)*(b*d2*d2-h1);
if (derta<)
{
printf("No\n");
continue;
}
x[]=(*b*d2+sqrt(derta))/(*(a+b));
x[]=(*b*d2-sqrt(derta))/(*(a+b));
if(x[]<&&x[]<)
{
printf("No\n");
continue;
}
int flag[]={,};
for(int i=;i<;i++)
{
if(d1-x[i]>)
{
//if((-b*pow(d1-x[i],2)+(-a*pow(x[i],2)+h1))>=h2)
if(b*(d1-d2)*(d1-d2)>=h2)
{
flag[i]=;
break;
}
}
else
{
if((-a*pow(d1,)+h1)>=h2)
{
flag[i]=;
break;
}
}
}
if (flag[]==||flag[]==)
printf("Yes\n");
else
printf("No\n");
}
return ;
}

ZOJ 3235 Prototype的更多相关文章

  1. js闭包 和 prototype

    function test(){ var p=200; function q(){ return p++; } return q; } var s = test(); alert(s()); aler ...

  2. PHP设计模式(六)原型模式(Prototype For PHP)

    原型设计模式: 用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象. 原型设计模式简单的来说,顾名思义, 不去创建新的对象进而保留原型的一种设计模式. 缺点:原型设计模式是的最主要的缺点就 ...

  3. Function.prototype.toString 的使用技巧

    Function.prototype.toString这个原型方法可以帮助你获得函数的源代码, 比如: function hello ( msg ){ console.log("hello& ...

  4. 分析js中的constructor 和prototype

    在javascript的使用过程中,constructor 和prototype这两个概念是相当重要的,深入的理解这两个概念对理解js的一些核心概念非常的重要. 我们在定义函数的时候,函数定义的时候函 ...

  5. C#设计模式:原型模式(Prototype)及深拷贝、浅拷贝

    原型模式(Prototype) 定义: 原型模式:用原型实例指定创建对象的种类,并且通过复制这些原型创建新的对象.被复制的实例被称为原型,这个原型是可定制的. Prototype Pattern也是一 ...

  6. ZOJ People Counting

    第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...

  7. 关于JS的prototype

    在接触JS的过程中,随着理解的深入会逐渐的理解一些比较深奥的理论或者知识,那么今天我们来介绍一下比较难理解的prototype和constructor. 初步理解: 在说prototype和const ...

  8. js中的原型prototype

    var arr1 = new Array(12,34,98,43,38,79,56,1); arr1.sum=function (){ var result = 0; for(var i=0; i&l ...

  9. [基础] Array.prototype.indexOf()查询方式

    背景 最近在看Redux源码,createStore用于注册一个全局store,其内部维护一个Listeren数组,存放state变化时所有的响应函数. 其中store.subscribe(liste ...

随机推荐

  1. 使用netcat的正向 / 反向shell

    reverse shell bind shell reverse shell描述图: 在此示例中,目标使用端口4444反向连接攻击主机.-e选项将Bash shell发回攻击主机.请注意,我们也可以在 ...

  2. java递归遍历获取目录下所有文件

    import java.io.File; import java.util.ArrayList; import java.util.List; public class GetFiles { Arra ...

  3. 【日记】NOIP2018

    day-2: 最后一次走出机房,刚下过几天的雨,感受到的是彻骨的寒意.下午离开教室,跟班主任请了接下来几天的假,班主任斜视了我一眼,哼了一声,确认了一下,不再理会我了.班里的同学或是忙着自己的作业,或 ...

  4. 工作常用shell集合

    <1>日志回滚案例======>[root@localhost test]# cat hbase.sh hbase_rotate_log ()       {    log=$1;  ...

  5. ActiveMQ:初见&安装试运行

    官网:http://activemq.apache.org/ ActiveMQ是一个消息中间件,在大型互联网应用中有广泛的使用. 当前最新版本:5.15.4,发布于2018-05-22,开源.Apac ...

  6. WordPress“无法将上传的文件移动至wp-content/uploads/”的解决办法

    WordPress“无法将上传的文件移动至wp-content/uploads/”的问题在有些配置不完善的虚拟主机或服务器中会碰到,一般会出现以下症状:1.无论是从文章编辑页面还是媒体库页面都无法上传 ...

  7. Sqlserver双机热备文档(无域)

    1. 配制环境 OS:Win7    DB:SQL Server R2 2. 基本配制 1.      开启sqlServer服务如下图-1 图-1 2.      开启sqlServer的tcp/i ...

  8. Python装饰器讲解

    Python装饰器讲解 定义:本质是函数,就是为其他函数添加附加功能.原则:1.不能修改被装饰的函数的源代码 2.不能修改被装饰的函数的调用方式 import time def timmer(func ...

  9. appium----【Mac】address already in user 127.0.0.1:4725,端口被占用的查找与kill进程

    报错截图示例: 解决方法: Mac: lsof -i tcp:4723   #查看端口号   sudo kill -9 29443   #杀死进程   Windows: netstat -aon|fi ...

  10. CCF201712真题

    试题编号: 201712-1 试题名称: 最小差值 时间限制: 1.0s 内存限制: 256.0MB 问题描述: 问题描述 给定n个数,请找出其中相差(差的绝对值)最小的两个数,输出它们的差值的绝对值 ...