QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#295233 | #5461. Paddle Star | ushg8877 | AC ✓ | 141ms | 3992kb | C++14 | 1.1kb | 2023-12-30 21:22:09 | 2023-12-30 21:22:09 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define MP make_pair
mt19937 rnd(time(0));
const long double pi=acos(-1);
long double solve(){
long double x,y,a,b;cin>>x>>y>>a>>b;
a=a/180*pi,b=b/180*pi;
long double ans=y*y*b+(x+y)*(x+y)*a;
if(b>pi/2){
long double r=sqrt(x*x+y*y-2*cos(pi-b)*x*y);
long double c=acos((r*r+x*x-y*y)/(2*r*x)),d=acos((r*r+y*y-x*x)/(2*r*y));
// cerr<<r<<' '<<c<<endl;
if(r*r+y*y<x*x){
ans+=2*(0.5*sin(pi-b)*x*y-c/(2*pi)*r*r*pi);
if(c>2*a){
auto f=[&](long double l,long double a,long double b){
long double n=l/sin(a+b)*sin(b);
return 0.5*n*l*sin(a)-l*l*pi*(b/(2*pi));
};
ans-=2*f(r,d,c-2*a);
}
}else{
long double h=sin(pi-b)*x;
ans+=2*(0.5*sin(pi-b)*cos(pi-b)*x*x-(b-pi/2)/(2*pi)*h*h*pi);
if(b-pi/2>2*a){
auto f=[&](long double r,long double a){
// cout<<r<<' '<<a<<endl;
return 0.5*r*r*tan(a)-a/(2*pi)*r*r*pi;
};
ans-=2*f(h,b-pi/2-2*a);
}
}
}
return ans;
}
int main(){
ios::sync_with_stdio(false);
int _;cin>>_;
while(_--) cout<<setprecision(12)<<solve()<<endl;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3900kb
input:
5 2 1 20 20 3 3 0 0 20 20 90 120 20 10 50 170 100 10 1 93
output:
3.49065850399 0 3367.15761191 1098.86327898 373.96048957
result:
ok 5 numbers
Test #2:
score: 0
Accepted
time: 128ms
memory: 3848kb
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.9916132 13636.4792655 19433.1705026 61610.1225954 17006.233727 15903.667037 37972.6398435 13840.1119025 14968.8045203 9194.79592523 31073.4929367 16982.1207432 12675.9304202 36683.242952 658.687259703 62718.1972158 65696.5666928 29465.9748824 23128.0289502 41946.0282993 11050.5789317 3826.33767...
result:
ok 100000 numbers
Test #3:
score: 0
Accepted
time: 110ms
memory: 3928kb
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 0.0174532925199 0.0349065850399 0.0523598775598 0.0698131700798 0.0872664625997 0.10471975512 0.12217304764 0.13962634016 0.157079632679 0.174532925199 0.191986217719 0.209439510239 0.226892802759 0.244346095279 0.261799387799 0.279252680319 0.296705972839 0.314159265359 0.331612557879 0.349065850...
result:
ok 100000 numbers
Test #4:
score: 0
Accepted
time: 124ms
memory: 3964kb
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 0.0174532925199 0.0349065850399 0.0523598775598 0.0698131700798 0.0872664625997 0.10471975512 0.12217304764 0.13962634016 0.157079632679 0.174532925199 0.191986217719 0.209439510239 0.226892802759 0.244346095279 0.261799387799 0.279252680319 0.296705972839 0.314159265359 0.331612557879 0.349065850...
result:
ok 100000 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 3892kb
input:
1 1 1 0 0
output:
0
result:
ok found '0.0000000', expected '0.0000000', error '-0.0000000'
Test #6:
score: 0
Accepted
time: 103ms
memory: 3928kb
input:
100000 2 1 24 89 3 1 76 68 2 2 52 144 3 3 4 2 2 2 86 44 3 2 87 123 3 2 2 53 3 1 50 172 3 3 86 156 2 2 46 1 3 3 74 71 2 2 20 104 2 2 29 86 3 3 2 30 2 2 26 178 3 2 14 108 3 3 90 69 3 2 13 175 3 3 52 35 2 2 73 31 3 3 77 105 3 1 86 143 3 3 50 109 3 1 13 94 3 2 41 139 2 2 51 154 2 1 57 40 3 3 27 112 2 2 ...
output:
5.32325421858 22.4100275956 25.1738766201 2.82743338823 27.087509991 47.0128860698 4.57276264023 17.1015256593 80.1688642414 12.9154364648 57.6482251934 12.8643846364 14.1022603561 5.96902604182 19.8188656721 13.736070861 67.3871624195 18.2334376566 38.1703507411 22.5496539358 64.9255289092 26.92712...
result:
ok 100000 numbers
Test #7:
score: 0
Accepted
time: 0ms
memory: 3900kb
input:
1 1 1 1 1
output:
0.0872664625997
result:
ok found '0.0872665', expected '0.0872665', error '0.0000000'
Test #8:
score: 0
Accepted
time: 123ms
memory: 3980kb
input:
100000 71 6 33 34 98 20 79 171 88 16 59 8 45 21 36 79 88 61 44 149 55 47 72 86 81 8 85 122 68 2 35 71 98 91 79 49 73 19 68 148 69 66 81 22 99 94 87 130 65 53 43 53 97 89 84 1 93 88 77 6 83 46 2 51 83 69 46 95 91 55 17 137 93 84 1 54 61 45 74 15 77 65 0 21 84 71 6 32 87 81 37 76 91 55 32 154 73 34 76...
output:
3436.22168462 20453.8997142 11173.4582449 3345.01077791 27858.125443 16389.7237804 11913.3689208 2998.19640225 56334.4809588 11128.1167241 27437.570679 77419.2591703 13048.2385675 50858.6326037 44838.5731346 2464.36999723 26444.6360923 14434.0150804 7196.91753048 15041.9281721 1548.54337883 5331.317...
result:
ok 100000 numbers
Test #9:
score: 0
Accepted
time: 106ms
memory: 3916kb
input:
100000 10 1 40 160 6 6 27 16 10 10 7 41 4 1 38 161 7 6 66 143 6 4 26 127 8 4 47 99 4 4 49 121 5 2 68 122 8 8 27 178 10 8 73 125 6 2 20 175 10 1 34 13 7 4 66 102 10 10 14 179 9 7 64 120 7 5 47 169 10 8 68 90 8 2 37 3 5 5 10 164 4 2 26 62 7 5 43 40 1 1 35 103 10 7 71 102 6 1 90 63 6 4 49 44 6 3 84 123...
output:
87.5849133579 77.911497809 120.427718388 19.6909239887 291.658182925 83.3184895803 145.851363237 89.2261953793 67.6719994426 321.571228728 558.426573155 34.9039348265 72.0297382298 168.011900637 411.827515292 391.8455079 196.280472188 485.061905714 64.786621834 92.3584692325 20.6646983436 125.524079...
result:
ok 100000 numbers
Test #10:
score: 0
Accepted
time: 130ms
memory: 3976kb
input:
100000 8 8 89 18 10 1 17 44 6 1 43 5 11 10 84 74 11 11 64 172 10 7 85 51 7 6 71 176 9 7 51 99 5 3 12 54 6 5 26 32 3 2 21 23 10 10 59 151 9 9 81 45 7 4 2 37 11 6 3 172 11 10 65 98 11 10 78 173 7 2 9 104 10 9 46 77 8 3 24 100 11 9 77 41 10 10 55 30 11 6 37 75 9 7 25 56 10 9 14 7 9 9 12 179 11 9 6 130 ...
output:
417.762009757 36.6693675844 36.8613538021 775.694132756 917.192986614 472.35590876 322.464590123 312.63921217 21.88642882 68.8706922837 10.7686814848 692.821232732 521.661460129 14.5560459616 127.726396981 671.449407348 913.466888314 20.2138463713 398.685561033 66.5036820653 595.523794073 436.332312...
result:
ok 100000 numbers
Test #11:
score: 0
Accepted
time: 126ms
memory: 3904kb
input:
100000 7 3 55 160 4 3 14 72 9 7 4 52 9 9 31 71 12 1 87 116 9 7 10 154 12 10 20 100 6 5 61 69 12 12 55 130 12 11 7 163 4 3 43 178 11 11 42 155 12 1 20 1 5 3 72 151 7 2 74 136 10 10 66 76 11 11 84 176 8 6 59 110 12 2 54 47 12 12 38 28 12 12 38 105 12 12 60 173 12 4 48 76 2 1 71 31 3 1 21 123 12 7 83 2...
output:
123.848168842 23.2826922216 62.3431608812 275.674755353 258.992530854 187.418244337 343.731350761 158.929681687 891.558109336 425.573601551 65.0474040238 703.955421939 59.0095820099 107.152855427 115.790851182 593.411945678 1088.80259918 271.787210817 188.006867025 452.389342117 646.737699378 1052.3...
result:
ok 100000 numbers
Test #12:
score: 0
Accepted
time: 115ms
memory: 3932kb
input:
100000 12 8 12 17 7 1 3 24 13 13 40 16 9 9 77 68 11 1 2 137 8 5 43 153 11 10 60 93 9 4 54 124 13 11 90 62 13 11 23 10 9 5 65 152 13 10 81 159 9 5 0 100 2 1 8 10 13 4 29 108 11 9 33 62 1 1 7 0 7 6 9 117 10 7 79 17 6 3 44 136 9 1 89 169 12 12 90 59 11 11 67 48 8 2 50 165 12 3 36 39 11 2 46 157 12 7 57...
output:
102.764986357 3.76991118431 519.130732713 531.557476987 7.89585525123 201.659447814 624.135520746 197.885993911 1035.71328472 252.339703253 297.24877079 1051.61143119 43.6332312999 1.43116998664 178.080101488 318.033896298 0.488692190558 101.498343169 413.014714192 86.5755164858 158.470635636 1053.0...
result:
ok 100000 numbers
Test #13:
score: 0
Accepted
time: 111ms
memory: 3928kb
input:
100000 16 6 41 45 19 4 51 119 1 1 20 49 20 20 68 30 20 20 56 133 16 6 69 27 13 12 17 12 11 6 33 146 12 9 51 156 7 7 6 125 20 17 76 123 20 13 14 80 20 20 50 160 10 9 89 177 13 4 0 61 18 4 65 36 10 5 34 167 17 15 73 74 18 1 26 107 17 8 6 65 10 5 14 130 19 6 51 73 11 1 75 177 14 3 76 96 8 3 31 9 7 5 13...
output:
374.617470648 509.228455427 2.25147473507 2108.35773641 2531.27433701 599.834757325 215.600522499 270.926866137 635.711065502 129.606175914 2456.98721922 502.061412629 2584.66551802 815.152005833 17.0344134995 559.133679169 211.681588457 1595.26584291 165.930795653 138.055543833 118.7941334 602.1909...
result:
ok 100000 numbers
Test #14:
score: 0
Accepted
time: 122ms
memory: 3964kb
input:
100000 21 19 6 6 17 6 48 147 16 10 56 89 18 18 89 19 19 18 79 85 15 7 12 18 20 18 57 117 17 16 36 117 9 6 12 81 20 19 4 76 19 18 7 97 21 2 79 160 21 19 5 4 21 19 25 119 14 10 54 129 21 17 49 21 21 13 48 179 14 14 31 80 18 17 51 1 8 4 37 1 13 9 90 118 14 14 47 64 16 11 3 74 20 15 30 42 19 19 38 133 1...
output:
205.35543979 550.064867878 816.046145062 2120.57504117 2368.25471532 116.762526958 2110.32317793 1215.78417125 98.017690792 585.034365268 715.994457121 741.835073303 164.828894558 1464.15553899 783.297607029 1340.84919784 1499.37588201 697.852448117 1095.43845172 93.2703952266 932.751591035 862.0530...
result:
ok 100000 numbers
Test #15:
score: 0
Accepted
time: 100ms
memory: 3836kb
input:
100000 14 12 55 44 19 19 55 175 18 18 25 53 18 12 61 16 22 19 85 30 21 17 53 122 22 22 80 110 20 17 46 87 19 11 64 165 5 1 20 110 19 6 46 176 22 22 45 164 22 18 77 35 22 4 69 53 17 2 34 93 22 17 33 179 16 12 79 106 17 17 64 87 22 16 60 76 12 4 43 109 18 10 51 174 11 8 60 26 19 17 5 46 14 12 75 101 2...
output:
759.497477298 2516.02760649 865.194616799 998.398145311 2682.8328597 1972.15162988 3638.74911589 1537.93177698 1382.21815288 14.689817209 614.867582302 2986.65074448 2348.16597563 828.891768357 220.728142887 1783.94888614 1349.16658318 1730.09252762 1851.7245232 224.201281432 1011.841111 407.0805947...
result:
ok 100000 numbers
Test #16:
score: 0
Accepted
time: 113ms
memory: 3904kb
input:
100000 22 20 49 129 22 1 9 42 29 27 41 134 29 29 72 80 27 16 71 123 28 7 21 71 25 13 70 133 28 11 27 60 29 28 68 3 23 5 1 168 27 22 79 16 29 10 17 81 27 15 90 119 29 28 86 79 22 21 69 122 27 27 49 139 16 8 11 97 16 11 4 58 12 11 32 128 18 8 35 146 29 22 27 19 30 15 50 115 15 2 24 72 18 6 80 158 13 6...
output:
2446.92214916 83.8281639733 4035.07012267 5401.58459541 2878.48141204 509.705954752 2207.41585783 843.465267611 3897.04096702 91.3684402917 3445.68136916 592.6614541 3265.05530995 5957.68140168 3188.8309213 4354.96768239 219.088323702 173.381007893 576.322709524 600.600640033 1386.19285181 2240.9092...
result:
ok 100000 numbers
Test #17:
score: 0
Accepted
time: 141ms
memory: 3844kb
input:
100000 39 35 57 118 18 2 33 138 37 28 62 114 40 2 11 130 11 9 78 113 23 17 47 122 29 7 65 143 36 27 11 77 24 19 77 38 34 30 5 12 12 2 74 14 38 31 37 82 36 34 15 85 39 27 17 161 37 15 46 80 40 14 33 54 37 30 88 95 40 22 9 111 36 36 12 52 40 40 48 151 40 39 41 163 21 16 42 73 18 2 64 146 40 37 84 152 ...
output:
8021.61292524 241.910091287 6161.90046429 349.647106949 706.655863043 1953.10391045 1613.99598247 1741.69896715 2724.30188273 545.938990024 254.11993909 4449.87400759 2997.77752323 3534.15874718 2485.06960216 1864.22108064 8387.16744357 1565.5957228 2261.94671058 9856.42793031 9066.13564374 1329.696...
result:
ok 100000 numbers
Test #18:
score: 0
Accepted
time: 122ms
memory: 3900kb
input:
100000 9 8 74 2 47 41 64 61 42 1 75 10 33 29 33 75 43 1 76 103 48 12 73 90 50 50 35 160 50 48 13 179 49 46 77 169 30 18 74 55 44 43 77 164 15 2 31 91 49 43 31 120 49 36 39 131 43 8 23 142 33 31 25 74 25 6 58 129 28 20 31 95 8 7 1 148 37 10 52 156 11 5 54 52 49 26 33 2 20 17 13 33 38 23 89 34 50 7 60...
output:
375.490135274 10439.8090939 2420.50987313 3314.85148844 2570.01010691 4812.9199453 13536.1656096 9417.11087674 18693.8565478 3286.73423419 15787.4617963 162.717444834 8548.79425096 8091.2507086 1231.61042936 3028.39059831 1068.3169862 1909.98196294 131.987563673 2312.65031649 263.963596072 3263.3642...
result:
ok 100000 numbers
Test #19:
score: 0
Accepted
time: 122ms
memory: 3848kb
input:
100000 985040437 963837006 74 178 562320397 456498961 21 57 616458849 43215539 12 112 967049313 962181597 55 20 404875500 323494205 16 148 822013814 350801410 65 117 493753261 325808227 72 151 883524417 55981080 1 165 756475575 306464991 75 65 982861539 971158777 53 2 977914232 494619050 34 80 92912...
output:
7.82303113924e+18 5.87759779771e+17 9.5369829971e+16 3.89596101379e+18 4.43752067878e+17 1.83205884175e+18 1.15741197158e+18 2.52114638778e+16 1.58551032348e+18 3.56484642375e+18 1.62832037939e+18 1.1748761028e+18 1.44209664567e+17 3.72321300955e+18 3.76450918927e+18 1.89245062057e+18 8.66938372866e...
result:
ok 100000 numbers
Test #20:
score: 0
Accepted
time: 129ms
memory: 3992kb
input:
100000 915624482 436335283 31 93 966989692 899762255 14 172 971565321 859650888 86 78 840892426 595383046 16 116 992919354 525701445 9 98 924698821 417910701 18 49 923077550 641792877 68 62 918753914 850646822 29 137 935549247 897719522 87 46 937380829 805246200 55 11 434960395 174040501 0 56 902102...
output:
1.29800266692e+18 3.37525352263e+18 6.03936828741e+18 1.31313365844e+18 8.35838455087e+17 7.15665701892e+17 3.35203406723e+18 3.41379408411e+18 5.7502924204e+18 3.03955771734e+18 2.96050667215e+16 2.07869124257e+18 6.30577265717e+18 2.87984908566e+17 4.26740151969e+18 8.46133811067e+17 5.68735728234...
result:
ok 100000 numbers