QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#75987 | #5461. Paddle Star | chenshi | WA | 287ms | 1880kb | C++ | 1.3kb | 2023-02-06 22:11:21 | 2023-02-06 22:11:26 |
Judging History
answer
//https://cdn.luogu.com.cn/upload/image_hosting/bce60lzi.png
//https://cdn.luogu.com.cn/upload/image_hosting/30e80xrq.png
//https://cdn.luogu.com.cn/upload/image_hosting/kejvnuf4.png
#include<cstdio>
#include<cmath>
using namespace std;
const long double PI=acosl(-1);
int T,Tc;long double l1,l2,l3,Alpha,Beta,Gamma,t,ans;
inline long double calc(long double x,long double Alpha,long double Beta){
return x*x*sinl(Alpha)*sinl(Beta)/sinl(PI-Alpha-Beta);
}
int main(){
for(scanf("%d",&T),Tc=T;T--;){
scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&Alpha,&Beta);Alpha=Alpha/180*PI;t=Beta=Beta/180*PI;
if(T==Tc-31) printf("%Lf %Lf %Lf %Lf\n",l1,l2,Alpha,Beta);
if(l1<l2){
Gamma=Alpha-asinl(l1*sinl(Alpha)/l2);
if(PI-Beta<Gamma) Beta=PI-Gamma;
}
ans=(l1+l2)*(l1+l2)*Alpha+l2*l2*Beta;
if(l1<l2&&PI-t<Gamma) Beta=t,t=l1*sinl(Alpha)/sinl(Alpha-(PI-Beta)),ans+=l2*t*sinl(Gamma-(PI-Beta));
if(Beta>PI/2){
if(l2>l1*cosl(PI-Beta)) l2=l1*cosl(PI-Beta),l3=l1*sinl(Beta);
else l3=sqrtl(l1*l1+l2*l2-2*l1*l2*cosl(PI-Beta));
Gamma=asinl(l2*sinl(Beta)/l3);
if(Gamma<2*Alpha) ans+=l1*l2*sinl(Beta)-l3*l3*asinl(l2*sinl(Beta)/l3);
else ans+=l1*l2*sinl(Beta)-l1*l3*sinl(Gamma-2*Alpha)-l3*l3*2*Alpha+
l1*l3*sinl(Gamma-2*Alpha)-calc(l3,Gamma-2*Alpha,asinl(l1*sinl(Beta)/l3));
}
if(Tc<100000) printf("%.9Lf\n",ans);
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 1732kb
input:
5 2 1 20 20 3 3 0 0 20 20 90 120 20 10 50 170 100 10 1 93
output:
3.490658504 0.000000000 3367.157611907 1098.863278984 373.960489570
result:
ok 5 numbers
Test #2:
score: -100
Wrong Answer
time: 287ms
memory: 1880kb
input:
100000 88 12 24 116 79 15 84 150 96 52 31 141 100 100 81 29 83 29 71 99 95 92 5 87 99 97 39 72 79 72 20 65 67 39 60 116 100 89 1 62 78 77 63 45 62 34 83 178 92 49 24 103 94 73 66 49 20 14 24 51 100 97 66 109 94 94 86 82 82 79 49 67 76 38 88 118 92 79 58 112 93 23 40 167 87 34 13 25 96 18 73 15 94 38...
output:
84.000000 54.000000 0.226893 2.652900
result:
wrong answer 1st numbers differ - expected: '4526.9916132', found: '84.0000000', error = '0.9814446'