<pre >#include<math.h>#include<stdio.h>#include<stdlib.h>struct point { double x,y,h;}a,b;void Swap(double & a,double & b){ double t; t=a; a=b; b=t;}bool check(double c,double d,double a,double b){ if(a*b<c*d)return false; if(a<b)Swap(a,b); if(c<d)Swap(c,d); if(b<d)return false; if(a>=c && b>=d)return true; double dis=sqrt(c*c+d*d); double p=asin(b/dis); double q=asin(d/dis); double sita=p-q; double Len=c*cos(sita)+d*sin(sita); if(Len<=a)return true; return false;}int main(){ scanf("%lf %lf %lf %lf %lf",&a.x,&a.y,&a.h,&b.x,&b.y); if(check(a.x,a.y,b.x,b.y)||check(a.x,a.h,b.x,b.y)||check(a.y,a.h,b.x,b.y))puts("YES"); else puts("NO"); return 0;}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)