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. C++ 和 MFC的学习

    1. 在Windows应用程序设计中,既可以使用个C的基本数据类型,也可以使用Windows自定义的数据类型.但要注意,凡是Windows自定义的关键字都要大写. 2. 什么是句柄? 在Windows ...

  2. my.cnf 详解与优化【转】

    MySQL配置文件my.cnf 例子最详细翻译,可以保存做笔记用. #BEGIN CONFIG INFO#DESCR: 4GB RAM, 只使用InnoDB, ACID, 少量的连接, 队列负载大#T ...

  3. ipad webapp禁止长按选择

    1.禁止长按屏幕弹出对话框并选中文字 /*禁止长按选择文字事件*/ * { -webkit-touch-callout: none; -webkit-user-select: none; -khtml ...

  4. iconfont-矢量图标字体

    二.矢量图标使用 1.进入:http://www.iconfont.cn/  搜索你图标的关键字,然后将需要的图标字体加入购物车 加入购物车之后,添加到项目 2.点击查看在线连接,生成css代码,把代 ...

  5. Luogu P1160 【队列安排】

    详细的链表讲解 很明显的一个链表裸题 和普通的链表有一个区别就是这个题 可以O(1)插入,O(1)查询 然后我们为了方便,采用双向链表,定义s.f作为指针数组 更详细的解释见代码 #include&l ...

  6. apache camel 条件路由

    <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route id="e ...

  7. CCF CSP 201612-2 工资计算

    CCF计算机职业资格认证考试题解系列文章为meelo原创,请务必以链接形式注明本文地址 CCF CSP 201612-2 工资计算 问题描述 小明的公司每个月给小明发工资,而小明拿到的工资为交完个人所 ...

  8. PHP验证时有用的几段代码

    1.htmlspecialchars() htmlspecialchars() 函数把一些预定义的字符转换为 HTML 实体.预定义的字符是: & (和号) 成为 & " ( ...

  9. 自然语言处理系列-1.什么是NLP?

    常常会听到有人说,自然语言处理(NLP)是人工智能技术(AI)皇冠上的明珠.那么,从这句话上就能够看到,目前我们常常说的NLP其实是AI技术的一个分支,而且是较难的那一个分支. 那么,到底什么是NLP ...

  10. JAVAEE——宜立方商城03:商品类目选择、Nginx端口或域名区分虚拟机、Nginx反向代理、负载均衡、keepalived实现高可用

    1. 学习计划 第三天: 1.商品类目选择(EasyUI的tree实现) 2.图片上传 a) 图片服务器FastDFS(Nainx部分) 2. 商品类目选择 2.1. 原型 2.2. 功能分析 展示商 ...