标签:
0 1 1 1 1 0 4 3 3 3 3 4
Yes
#include<stdio.h> //#include<bits/stdc++.h> #include<string.h> #include<iostream> #include<math.h> #include<sstream> #include<set> #include<queue> #include<map> #include<vector> #include<algorithm> #include<limits.h> #define inf 0x3fffffff #define INF 0x3f3f3f3f #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define LL long long #define ULL unsigned long long using namespace std; double x1,y1,x2,y2,x3,y3; double x4,y4,x5,y5,x6,y6; double dis(double x_1,double y_1,double x_2,double y_2) { return sqrt((x_1-x_2)*(x_1-x_2)+(y_1-y_2)*(y_1-y_2)); } int main() { double d[3]; double e[3]; double r1,r2; while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4>>x5>>y5>>x6>>y6) { d[0]=dis(x1,y1,x2,y2); d[1]=dis(x1,y1,x3,y3); d[2]=dis(x2,y2,x3,y3); e[0]=dis(x4,y4,x5,y5); e[1]=dis(x4,y4,x6,y6); e[2]=dis(x5,y5,x6,y6); sort(d,d+3); sort(e,e+3); // cout<<d[0]<<endl; // cout<<e[0]<<endl; // printf("%f\n",d[0]/e[0]); r1=(double)d[0]/e[0]*1.0; r2=(double)(d[0]+d[1]+d[2])/(e[0]+e[1]+e[2])*1.0; if(abs(r1-r2)<=1e-6) { puts("Yes"); } else { puts("No"); } } return 0; }
标签:
原文地址:http://www.cnblogs.com/yinghualuowu/p/5003100.html