Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
118914 陈家宝 S1 C++ 通过 100 185 MS 256 KB 605 2024-01-02 13:37:25

Tests(10/10):


#include<bits/stdc++.h> using namespace std; double x[5],y[5],r,p,S,h,maxn,minn,dis1,dis2,dis3; int t; int main(){ scanf("%d",&t); while(t--){ scanf("%lf%lf%lf%lf%lf%lf%lf",&x[1],&y[1],&x[2],&y[2],&x[3],&y[3],&r); dis1=sqrt((x[1]-x[3])*(x[1]-x[3])+(y[1]-y[3])*(y[1]-y[3])); dis2=sqrt((x[2]-x[3])*(x[2]-x[3])+(y[2]-y[3])*(y[2]-y[3])); dis3=sqrt((x[1]-x[2])*(x[1]-x[2])+(y[1]-y[2])*(y[1]-y[2])); maxn=max(dis1,dis2)+r; p=(dis1+dis2+dis3)/2; S=sqrt(p*(p-dis1)*(p-dis2)*(p-dis3)); h=2*S/dis3; minn=h-r; printf("%.2lf ",minn); printf("%.2lf\n",maxn); } return 0; }


测评信息: