QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#76109#5461. Paddle StarzhouhuanyiAC ✓130ms4204kbC++141.1kb2023-02-07 18:42:232023-02-07 18:42:24

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-07 18:42:24]
  • 评测
  • 测评结果:AC
  • 用时:130ms
  • 内存:4204kb
  • [2023-02-07 18:42:23]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int read()
{
    char c=0;
    int sum=0;
    while (c<'0'||c>'9') c=getchar();
    while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
    return sum;
}
int T;
const double Pi=asin(1)*2;
double l1,l2,l3,l4,l5,l6,a,b,c,d,e;
int main()
{
    T=read();
    while (T--)
    {
	l1=read(),l2=read(),a=read()/180.0*Pi,b=read()/180.0*Pi;
	if (b<=Pi/2) printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b);
	else
	{
	    l3=l1*sin(Pi-b),l4=l1*cos(Pi-b);
	    if (l4<=l2)
	    {
		if (b-Pi/2<=2*a) printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l3*l4-l3*l3*(b-Pi/2));
		else c=b-Pi/2-2*a,l5=l3*tan(c),printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l3*l4-l3*l3*(2*a)-l3*l5);
	    }
	    else
	    {
		l5=sqrt(l1*l1+l2*l2-2*l1*l2*cos(Pi-b)),c=asin(sin(Pi-b)/l5*l2);
		if (c<=2*a) printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l1*l2*sin(Pi-b)-l5*l5*c);
		else d=c-2*a,e=b-c,l6=l5/sin(Pi-d-e)*sin(e),printf("%0.20lf\n",(l1+l2)*(l1+l2)*a+l2*l2*b+l1*l2*sin(Pi-b)-l5*l5*(2*a)-l5*l6*sin(d));
	    }
	}
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 4104kb

input:

5
2 1 20 20
3 3 0 0
20 20 90 120
20 10 50 170
100 10 1 93

output:

3.49065850398865906712
0.00000000000000000000
3367.15761190651073775371
1098.86327898408194414515
373.96048957008883917297

result:

ok 5 numbers

Test #2:

score: 0
Accepted
time: 118ms
memory: 3940kb

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.99161320287566923071
13636.47926547432507504709
19433.17050261267286259681
61610.12259539983642753214
17006.23372698732418939471
15903.66703697509001358412
37972.63984345006610965356
13840.11190246463411313016
14968.80452031827007886022
9194.79592523408791748807
31073.49293665664299624041
16982...

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 94ms
memory: 4204kb

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.00000000000000000000
0.01745329251994329547
0.03490658503988659095
0.05235987755982988989
0.06981317007977318190
0.08726646259971647390
0.10471975511965977979
0.12217304763960307179
0.13962634015954636379
0.15707963267948965580
0.17453292519943294780
0.19198621771937623981
0.20943951023931955957
0...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 68ms
memory: 4072kb

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.00000000000000000000
0.01745329251994329547
0.03490658503988659095
0.05235987755982988989
0.06981317007977318190
0.08726646259971647390
0.10471975511965977979
0.12217304763960307179
0.13962634015954636379
0.15707963267948965580
0.17453292519943294780
0.19198621771937623981
0.20943951023931955957
0...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 2ms
memory: 3644kb

input:

1
1 1 0 0

output:

0.00000000000000000000

result:

ok found '0.0000000', expected '0.0000000', error '-0.0000000'

Test #6:

score: 0
Accepted
time: 98ms
memory: 4164kb

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.32325421858270519948
22.41002759560719326259
25.17387662013423010876
2.82743338823081380440
27.08750999095199674116
47.01288606975690953504
4.57276264022514311591
17.10152565934855672936
80.16886424139791245125
12.91543646475803797102
57.64822519337270279038
12.86438463638912921283
14.102260356114...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 2ms
memory: 3640kb

input:

1
1 1 1 1

output:

0.08726646259971647390

result:

ok found '0.0872665', expected '0.0872665', error '0.0000000'

Test #8:

score: 0
Accepted
time: 130ms
memory: 4068kb

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.22168461895626023761
20453.89971422095914022066
11173.45824492753854428884
3345.01077790973204173497
27858.12544302740934654139
16389.72378036299051018432
11913.36892082642771129031
2998.19640224593877064763
56334.48095881153130903840
11128.11672408229787833989
27437.57067902449489338323
77419....

result:

ok 100000 numbers

Test #9:

score: 0
Accepted
time: 115ms
memory: 4112kb

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.58491335790822063245
77.91149780902686927675
120.42771838760873492902
19.69092398866057536111
291.65818292500443931203
83.31848958025332763100
145.85136323723457962842
89.22619537933380229333
67.67199944258123878171
321.57122872841171101754
558.42657315458211542136
34.90393482653036727470
72.0297...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 100ms
memory: 4164kb

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.76200975736270493144
36.66936758440086663313
36.86135380212024159619
775.69413275635974969191
917.19298661432480912481
472.35590875974537539150
322.46459012276818612008
312.63921216968896032995
21.88642882000889500205
68.87069228369624340758
10.76868148480501297115
692.82123273217632686283
521.6...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 116ms
memory: 4120kb

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.84816884170680850730
23.28269222160435703017
62.34316088123745203120
275.67475535250434859336
258.99253085376147964780
187.41824433731963495120
343.73135076119882569401
158.92968168660362948685
891.55810933630152703699
425.57360155148950298098
65.04740402375242069866
703.95542193902861072274
59....

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 105ms
memory: 4168kb

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.76498635742612464128
3.76991118430775218329
519.13073271319331070117
531.55747698739310180827
7.89585525123272802261
201.65944781374352601233
624.13552074583640205674
197.88599391145933736880
1035.71328471847505170444
252.33970325334016138186
297.24877078987617551320
1051.61143118791642336873
43...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 108ms
memory: 4124kb

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.61747064806291973582
509.22845542721239553430
2.25147473507268491844
2108.35773640915022042464
2531.27433701217751149670
599.83475732541114666674
215.60052249885953301600
270.92686613720269406258
635.71106550170281934697
129.60617591404985660120
2456.98721922109962179093
502.06141262868885632997...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 112ms
memory: 3912kb

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.35543978965282008176
550.06486787803385141160
816.04614506246878136153
2120.57504117311009395053
2368.25471532362553261919
116.76252695842065065790
2110.32317793008542139432
1215.78417125393889364204
98.01769079200155942999
585.03436526849930032768
715.99445712084309434431
741.835073303215494888...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 116ms
memory: 4012kb

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.49747729785235605959
2516.02760649422816641163
865.19461679862911296368
998.39814531083618476259
2682.83285970308406831464
1972.15162988021415912954
3638.74911589289831681526
1537.93177697984356200323
1382.21815287995514154318
14.68981720896893250483
614.86758230206771713711
2986.650744477979515...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 119ms
memory: 4064kb

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.92214915535032560001
83.82816397328764423946
4035.07012267487016288214
5401.58459541221054678317
2878.48141203812929234118
509.70595475242396332760
2207.41585783073378479457
843.46526761129962324048
3897.04096702301876575802
91.36844029168887004744
3445.68136916476487385808
592.6614540997145468...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 121ms
memory: 4012kb

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.61292524291275185533
241.91009128740574851690
6161.90046428947334788973
349.64710694892136189083
706.65586304259079497569
1953.10391045377718910458
1613.99598246901064158010
1741.69896715018148825038
2724.30188273046951508150
545.93899002382624985330
254.11993909037437333609
4449.87400759222327...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 118ms
memory: 4172kb

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.49013527406003731812
10439.80909385172162728850
2420.50987312833603937179
3314.85148843527031203848
2570.01010691105284422520
4812.91994529956355108880
13536.16560961095819948241
9417.11087673731526592746
18693.85654775467264698818
3286.73423418564152598265
15787.46179631324048386887
162.7174448...

result:

ok 100000 numbers

Test #19:

score: 0
Accepted
time: 128ms
memory: 4112kb

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:

7823031139236862976.00000000000000000000
587759779770854656.00000000000000000000
95369829970997632.00000000000000000000
3895961013788279808.00000000000000000000
443752067877684928.00000000000000000000
1832058841745101824.00000000000000000000
1157411971581695232.00000000000000000000
25211463877824920...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 102ms
memory: 4204kb

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:

1298002666918419968.00000000000000000000
3375253522633562624.00000000000000000000
6039368287407980544.00000000000000000000
1313133658442171648.00000000000000000000
835838455087290240.00000000000000000000
715665701891950336.00000000000000000000
3352034067230078464.00000000000000000000
341379408411154...

result:

ok 100000 numbers