QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75981 | #5461. Paddle Star | chenshi | WA | 127ms | 1588kb | C++ | 1.2kb | 2023-02-06 21:55:35 | 2023-02-06 21:55:38 |
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;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);T--;printf("%.9Lf\n",ans)){
scanf("%Lf%Lf%Lf%Lf",&l1,&l2,&Alpha,&Beta);Alpha=Alpha/180*PI;t=Beta=Beta/180*PI;
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));
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 1556kb
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: 127ms
memory: 1588kb
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:
4526.991613203 13636.479265474 19433.170502613 61610.122595400 17006.233726987 15903.667036975 37972.639843450 13840.111902465 14968.804520318 9194.795925234 31073.492936657 16982.120743226 12675.930420195 36683.242951954 658.687259703 62718.197215759 65696.566692849 29465.974882400 23128.028950241 ...
result:
wrong answer 31st numbers differ - expected: '12961.4718368', found: '13011.1627474', error = '0.0038337'