QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#648241#5461. Paddle StarRepeater#AC ✓105ms4356kbC++201.3kb2024-10-17 17:50:272024-10-17 17:50:29

Judging History

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

  • [2024-10-17 17:50:29]
  • 评测
  • 测评结果:AC
  • 用时:105ms
  • 内存:4356kb
  • [2024-10-17 17:50:27]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

#define int long long

using db = long double;

const db pi = acosl(-1.0L);

void solve(){
	int l, r, a, b;
	cin >> l >> r >> a >> b;

	db x = pi * a / 180;
	db y = pi * b / 180;
	db ans = x * ((l + r) * (l + r)) + y * r * r;

	if(b > 90){
		if(sinl(y - pi / 2) * l <= r){
			ans += sinl(y - pi / 2) * l * cosl(y - pi / 2) * l;
			ans -= (y - pi / 2) * cosl(y - pi / 2) * l * cosl(y - pi / 2) * l;
			if(y - pi / 2 > x + x){
				db z = y - pi / 2 - x - x;
				db len = cosl(y - pi / 2) * l;
				ans -= tanl(z) * len * len;
				ans += z * len * len;
			}
		}else{
			ans += sinl(y) * l * r;
			db d = sqrtl(sinl(y) * r * sinl(y) * r + (l - r * cosl(pi - y)) * (l - r * cosl(pi - y)));
			ans -= asinl((sinl(y) * r) / d) * d * d;
			if(asinl((sinl(y) * r) / d) > x + x){
				db z = asinl((sinl(y) * r) / d) - x - x;
				ans -= sinl(z) * d * (d * cosl(z) + d * sinl(z) / tanl(x + x + pi - y));
				ans += z * d * d;
			}
		}
	}

	cout << ans << "\n";
	return;
}

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	cout << fixed << setprecision(20);

	int t; cin >> t;
	while(t--) solve();

	return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

3.49065850398865915385
0.00000000000000000000
3367.15761190651085499326
1098.86327898408187730972
373.96048957008772231636

result:

ok 5 numbers

Test #2:

score: 0
Accepted
time: 88ms
memory: 4212kb

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.99161320287554799435
13636.47926547432505994806
19433.17050261267052135850
61610.12259539983406497754
17006.23372698732650398767
15903.66703697509036707913
37972.63984345007019527429
13840.11190246463467978799
14968.80452031827099723671
9194.79592523408690674103
31073.49293665664492181122
16982...

result:

ok 100000 numbers

Test #3:

score: 0
Accepted
time: 73ms
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.01745329251994329577
0.03490658503988659154
0.05235987755982988731
0.06981317007977318308
0.08726646259971647885
0.10471975511965977462
0.12217304763960307038
0.13962634015954636615
0.15707963267948966193
0.17453292519943295770
0.19198621771937625346
0.20943951023931954924
0...

result:

ok 100000 numbers

Test #4:

score: 0
Accepted
time: 72ms
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.01745329251994329577
0.03490658503988659154
0.05235987755982988731
0.06981317007977318308
0.08726646259971647885
0.10471975511965977462
0.12217304763960307038
0.13962634015954636615
0.15707963267948966193
0.17453292519943295770
0.19198621771937625346
0.20943951023931954924
0...

result:

ok 100000 numbers

Test #5:

score: 0
Accepted
time: 0ms
memory: 3844kb

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: 76ms
memory: 4172kb

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.32325421858270520989
22.41002759560719176900
25.17387662013423161797
2.82743338823081391455
27.08750999095199503593
47.01288606975691050649
4.57276264022514349148
17.10152565934855867572
80.16886424139791622601
12.91543646475803886874
57.64822519337270592676
12.86438463638912880777
14.102260356114...

result:

ok 100000 numbers

Test #7:

score: 0
Accepted
time: 1ms
memory: 3952kb

input:

1
1 1 1 1

output:

0.08726646259971647885

result:

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

Test #8:

score: 0
Accepted
time: 88ms
memory: 4100kb

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.22168461895601465628
20453.89971422095951147924
11173.45824492753840573300
3345.01077790973235082106
27858.12544302741366308851
16389.72378036299121184527
11913.36892082642696522043
2998.19640224593912058992
56334.48095881153416897291
11128.11672408229584263495
27437.57067902449771779061
77419....

result:

ok 100000 numbers

Test #9:

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

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.58491335790821297885
77.91149780902687231599
120.42771838760874080626
19.69092398866057579999
291.65818292500441827331
83.31848958025332868571
145.85136323723456515389
89.22619537933379928185
67.67199944258124107155
321.57122872841173780167
558.42657315458215017134
34.90393482653036910657
72.0297...

result:

ok 100000 numbers

Test #10:

score: 0
Accepted
time: 78ms
memory: 3968kb

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.76200975736272752448
36.66936758440086441269
36.86135380212024066637
775.69413275635983717748
917.19298661432479613520
472.35590875974535668425
322.46459012276818409393
312.63921216968898594835
21.88642882000889289609
68.87069228369624510760
10.76868148480501348983
692.82123273217630798904
521.6...

result:

ok 100000 numbers

Test #11:

score: 0
Accepted
time: 78ms
memory: 4096kb

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.84816884170681060284
23.28269222160435655486
62.34316088123745248917
275.67475535250435669798
258.99253085376150437802
187.41824433731962266936
343.73135076119883968282
158.92968168660365127498
891.55810933630145792561
425.57360155148948846482
65.04740402375243341071
703.95542193902855371279
59....

result:

ok 100000 numbers

Test #12:

score: 0
Accepted
time: 86ms
memory: 4308kb

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.76498635742612549476
3.76991118430775188643
519.13073271319338936047
531.55747698739301598803
7.89585525123272669945
201.65944781374350393277
624.13552074583639267535
197.88599391145932934744
1035.71328471847505758863
252.33970325334017022201
297.24877078987622480710
1051.61143118791673267687
43...

result:

ok 100000 numbers

Test #13:

score: 0
Accepted
time: 84ms
memory: 4356kb

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.61747064806290039018
509.22845542721234968209
2.25147473507268515436
2108.35773640915012894226
2531.27433701217785988469
599.83475732541118902175
215.60052249885953264130
270.92686613720269822592
635.71106550170278698397
129.60617591404984451364
2456.98721922109974147297
502.06141262868884608817...

result:

ok 100000 numbers

Test #14:

score: 0
Accepted
time: 87ms
memory: 4308kb

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.35543978965281804172
550.06486787803374544081
816.04614506246873695261
2120.57504117311043589922
2368.25471532362574622610
116.76252695842064870807
2110.32317793008522910370
1215.78417125393904640873
98.01769079200154904247
585.03436526849927423743
715.99445712084305820655
741.835073303215473294...

result:

ok 100000 numbers

Test #15:

score: 0
Accepted
time: 89ms
memory: 4228kb

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.49747729785245875522
2516.02760649422852856638
865.19461679862905789662
998.39814531083629117747
2682.83285970308370926851
1972.15162988021416001772
3638.74911589289796065572
1537.93177697984339336035
1382.21815287995526910780
14.68981720896893301397
614.86758230206771702608
2986.650744477979553...

result:

ok 100000 numbers

Test #16:

score: 0
Accepted
time: 80ms
memory: 4128kb

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.92214915535029073901
83.82816397328764958241
4035.07012267486978873698
5401.58459541221072086614
2878.48141203812981880894
509.70595475242400967941
2207.41585783073393334242
843.46526761129965471531
3897.04096702301885257747
91.36844029168887076214
3445.68136916476528064379
592.6614540997144944...

result:

ok 100000 numbers

Test #17:

score: 0
Accepted
time: 88ms
memory: 4136kb

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.61292524291302452610
241.91009128740572371730
6161.90046428947284740119
349.64710694892136827461
706.65586304259079747370
1953.10391045377729812849
1613.99598246901080511595
1741.69896715018137145492
2724.30188273046898017604
545.93899002382629170871
254.11993909037438639509
4449.87400759222274...

result:

ok 100000 numbers

Test #18:

score: 0
Accepted
time: 81ms
memory: 4132kb

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.49013527406006515696
10439.80909385172196657265
2420.50987312833597386863
3314.85148843527033557521
2570.01010691105280892010
4812.91994529956324111453
13536.16560961095895532225
9417.11087673731505454100
18693.85654775467124011357
3286.73423418564168607681
15787.46179631323959657863
162.7174448...

result:

ok 100000 numbers

Test #19:

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

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:

7823031139236863725.00000000000000000000
587759779770854607.25000000000000000000
95369829970997627.03125000000000000000
3895961013788279843.50000000000000000000
443752067877684930.78125000000000000000
1832058841745101878.37500000000000000000
1157411971581695296.12500000000000000000
25211463877824920...

result:

ok 100000 numbers

Test #20:

score: 0
Accepted
time: 101ms
memory: 4160kb

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:

1298002666918420132.25000000000000000000
3375253522633562204.75000000000000000000
6039368287407980498.50000000000000000000
1313133658442171590.87500000000000000000
835838455087290181.62500000000000000000
715665701891950401.12500000000000000000
3352034067230078528.00000000000000000000
341379408411154...

result:

ok 100000 numbers