本文共 2035 字,大约阅读时间需要 6 分钟。
23.0000000 0.00000000.9270509 2.85316950.9270509 -2.8531695-2.4270509 1.7633557-2.4270509 -1.76335573.0000000 1.00000000.9270509 2.85316950.9270509 -2.8531695-2.4270509 1.7633557-2.4270509 -1.7633557
YesNo Hint
#include#include #include #include using namespace std;double length[5][5];double point[5][2];const double MIN=1e-4;int main(){ int t,i,j; scanf("%d",&t); while(t--){ bool ok=1; for(i=0;i<5;i++) scanf("%lf%lf",&point[i][0],&point[i][1]); for(i=0;i<5;i++){ for(j=0;j<5;j++){ if(i==j){ length[i][j]=0.0; continue; } length[i][j]=(point[i][0]-point[j][0])* (point[i][0]-point[j][0])+(point[i][1]-point[j][1])* (point[i][1]-point[j][1]); } sort(length[i],length[i]+5); } /* for(i=0;i<5;i++){ printf("%0.6lf\n",length[i][1]); }*/ for(i=1;i<5;i++){ //printf("%0.6lf\n",fabs(length[0][1]-length[i][1])); if(fabs(length[0][1]-length[i][1])>MIN) ok=0; } if(ok) printf("Yes\n"); else printf("No\n"); } return 0;}
转载地址:http://sfmvi.baihongyu.com/