QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#75965 | #5461. Paddle Star | pechpo | WA | 124ms | 1580kb | C++20 | 1.2kb | 2023-02-06 20:07:26 | 2023-02-06 20:07:28 |
Judging History
answer
#include <cmath>
#include <cstdio>
using namespace std;
const long double PI=3.14159265358979323846;
int T;
int l1, l2, a, b;
long double a_, b_;
long double sqr(long double x){ return x*x; }
long double S(long double alpha, long double r){
return alpha*r*r;
}
long double tran(long double alpha){ return PI*alpha/180; }
long double S1, S2, S3, S4;
long double l3, l4, c;
int main(){
scanf("%d", &T);
while (T--){
scanf("%d%d%d%d", &l1, &l2, &a, &b);
a_=tran(a); b_=tran(b);
S1=S(a_, l1+l2);
S2=S(b_, l2);
if (b<=90){
printf("%.15Lf\n", S1+S2);
continue;
}
long double b1=PI-b_;
l3=sqrtl(sqr(l1)+sqr(l2)-2*l1*l2*cosl(b1));
if (2*sqr(l2)-2*l1*l2*cosl(b1)>=0){ //用高代替l3
l3=l1*sinl(b1);
c=b_-PI/2;
} else c=asinl(l2*sinl(b1)/l3>=1?1:l2*sinl(b1)/l3);
S3=l1*l3*sinl(c)-S(c, l3);
if (c>2*a_){ //要减一块
l4=l3*sinl(b1+c)/sinl(2*a_+b1);
S4=l3*l4*sin(c-2*a_)-S(c-2*a_,l3);
} else S4=0;
printf("%.15Lf\n", S1+S2+S3-S4);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 1580kb
input:
5 2 1 20 20 3 3 0 0 20 20 90 120 20 10 50 170 100 10 1 93
output:
3.490658503988659 0.000000000000000 3367.157611906510728 1098.863278984081835 373.960489570087709
result:
ok 5 numbers
Test #2:
score: 0
Accepted
time: 124ms
memory: 1572kb
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.991613202875377 13636.479265474324529 19433.170502612669816 61610.122595399831656 17006.233726987325849 15903.667036975089747 37972.639843450068710 13840.111902464634139 14968.804520318270448 9194.795925234086548 31073.492936656643709 16982.120743226402286 12675.930420194696629 36683.2429519542...
result:
ok 100000 numbers
Test #3:
score: -100
Wrong Answer
time: 97ms
memory: 1496kb
input:
100000 1 1 0 0 1 1 0 1 1 1 0 2 1 1 0 3 1 1 0 4 1 1 0 5 1 1 0 6 1 1 0 7 1 1 0 8 1 1 0 9 1 1 0 10 1 1 0 11 1 1 0 12 1 1 0 13 1 1 0 14 1 1 0 15 1 1 0 16 1 1 0 17 1 1 0 18 1 1 0 19 1 1 0 20 1 1 0 21 1 1 0 22 1 1 0 23 1 1 0 24 1 1 0 25 1 1 0 26 1 1 0 27 1 1 0 28 1 1 0 29 1 1 0 30 1 1 0 31 1 1 0 32 1 1 0 ...
output:
0.000000000000000 0.017453292519943 0.034906585039887 0.052359877559830 0.069813170079773 0.087266462599716 0.104719755119660 0.122173047639603 0.139626340159546 0.157079632679490 0.174532925199433 0.191986217719376 0.209439510239320 0.226892802759263 0.244346095279206 0.261799387799149 0.2792526803...
result:
wrong answer 98285th numbers differ - expected: '4229748020486743040.0000000', found: '4236742989445171200.0000000', error = '0.0016538'