传送门

分析



根据这张图,我们只要使得h<=y即可,可以发现h是一个凸函数,故使用三分,具体见代码

代码

#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
using namespace std;
const double eps = 1e-7;
const double pi = acos(-1.0);
#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
#pragma comment(linker, "/STACK:102400000,102400000")
inline void read(int &x){x=0; char ch=getchar();while(ch<'0') ch=getchar();while(ch>='0'){x=x*10+ch-48; ch=getchar();}} double x,y,l,w;
double calc(double ret)
{
double s,h;
s=l*cos(ret)+w*sin(ret)-x;
h=s*tan(ret)+w*cos(ret);
return h;
}
int main()
{
while(scanf("%lf%lf%lf%lf",&x,&y,&l,&w)!=EOF)
{
double left=0,right=pi/2;
while(right-left>eps)
{
double lm=left+(right-left)/3.0;
double rm=right-(right-left)/3.0;
if(calc(lm)<calc(rm)) left=lm;
else right=rm;
}
if(calc(left)<=y) puts("yes");else puts("no");
}
}

最新文章

  1. 代码的坏味道(12)——平行继承体系(Parallel Inheritance Hierarchies)
  2. c语言第一章第一节 认识变量
  3. Linux系统管理命令之用户管理
  4. 2016年11月2日--Window.document对象
  5. CSS行内元素和块级元素的居中
  6. pixel art之 hqx 算法
  7. rsync+inotify 实现服务器之间目录文件实时同步(转)
  8. Linux命令行–理解Linux文件权限(转)
  9. echarts 各种细节问题
  10. 读jQuery官方文档:jQuery对象
  11. C#中多线程写DataGridView出现滚动条导致程序卡死(无响应)的解决办法
  12. python学习之--自定义函数:
  13. List&lt;T&gt;分组一
  14. C#实现在线更新系统
  15. Grub禁用UUID
  16. 四、Attribute
  17. 【读书笔记】iOS-微信公众平台搭建与开发揭秘
  18. day29 socketsever ftp功能简单讲解
  19. [MyBatis] MyBatis理论入门
  20. ListView鼠标框选实现蓝色蒙板

热门文章

  1. 机房收费系统(VB.NET)个人版总结
  2. 线程相关函数(POSIX线程):
  3. Python常用的包
  4. 李洪强iOS开发之-修改状态栏的字体的颜色
  5. python day-3 基本数据类型
  6. 组合式+迭代式+链式 MapReduce
  7. 一条数据的HBase之旅,简明HBase入门教程-开篇
  8. 百度dureos CMake Error
  9. 常用bluetooth协议
  10. HDU2594 Simpsons’ Hidden Talents —— KMP next数组