QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#501522 | #2267. Jewelry Size | yzkkai | WA | 6ms | 3996kb | C++20 | 1.1kb | 2024-08-02 20:01:15 | 2024-08-02 20:01:17 |
Judging History
answer
#include <bits/stdc++.h>
#define sz(x) signed(size(x))
using namespace std;
using ll = long long;
using LL = long long;
using ld = long double;
inline void solve() {
int n;
cin >> n;
vector<int> a(n);
for (int& i : a)
cin >> i;
ld l = 0, r = 10000001;
while (r - l > 1e-6) {
ld mid = (l + r) / 2;
ld sum = 0, mx = 0;
for (int i = 0; i < n; ++i) {
ld th = 1.0 - 1.0 * a[i] * a[i] / (2 * mid * mid);
if (a[i] > mid + mid + 1e-6) {
sum = 1e9;
break;
}
mx = max(mx, acos(th));
sum += acos(th);
}
if (sum < 2 * M_PI){
if(mx > sum - mx){
l = mid;
continue;
}
r = mid;
}
else
l = mid;
}
cout << setprecision(10) << r << '\n';
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
int t = 1;
while (t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3844kb
input:
5 3 1 6 1 7
output:
3.544404662
result:
ok found '3.5444047', expected '3.5444044', error '0.0000001'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
3 500 300 400
output:
250.0000005
result:
ok found '250.0000005', expected '250.0000000', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
8 2000 3000 4000 2000 3000 4000 2000 3000
output:
3780.974121
result:
ok found '3780.9741210', expected '3780.9741206', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
10 602 67 67 67 67 67 67 67 67 67
output:
3003.139817
result:
ok found '3003.1398170', expected '3003.1398170', error '0.0000000'
Test #5:
score: 0
Accepted
time: 6ms
memory: 3808kb
input:
1000 4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 30...
output:
490696.1298
result:
ok found '490696.1298000', expected '490696.1297935', error '0.0000000'
Test #6:
score: 0
Accepted
time: 6ms
memory: 3848kb
input:
1000 2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 43...
output:
463780.0485
result:
ok found '463780.0485000', expected '463780.0484799', error '0.0000000'
Test #7:
score: 0
Accepted
time: 6ms
memory: 3876kb
input:
1000 1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 31...
output:
474979.6236
result:
ok found '474979.6236000', expected '474979.6236043', error '0.0000000'
Test #8:
score: 0
Accepted
time: 6ms
memory: 3848kb
input:
1000 2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 11...
output:
462340.8563
result:
ok found '462340.8563000', expected '462340.8562630', error '0.0000000'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
100 4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 303...
output:
48616.36963
result:
ok found '48616.3696300', expected '48616.3696323', error '0.0000000'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3792kb
input:
100 2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 432...
output:
48970.93944
result:
ok found '48970.9394400', expected '48970.9394372', error '0.0000000'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3800kb
input:
100 1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 319...
output:
47884.14953
result:
ok found '47884.1495300', expected '47884.1495305', error '0.0000000'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
100 2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 115...
output:
48019.61517
result:
ok found '48019.6151700', expected '48019.6151651', error '0.0000000'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
10 4719 3755 2542 1190 5557 3641 5426 1578 5247 3181
output:
6009.545254
result:
ok found '6009.5452540', expected '6009.5452530', error '0.0000000'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
10 2443 973 5013 5104 418 5498 2436 5522 512 1539
output:
4889.467496
result:
ok found '4889.4674960', expected '4889.4674959', error '0.0000000'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
10 1854 1474 3499 1575 1422 3130 2402 5948 2378 2670
output:
4340.866171
result:
ok found '4340.8661710', expected '4340.8661710', error '0.0000000'
Test #16:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
10 2343 137 3849 255 2682 1652 1797 4299 3474 4549
output:
4123.01659
result:
ok found '4123.0165900', expected '4123.0165899', error '0.0000000'
Test #17:
score: 0
Accepted
time: 2ms
memory: 3804kb
input:
250 4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 303...
output:
128109.4065
result:
ok found '128109.4065000', expected '128109.4065170', error '0.0000000'
Test #18:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
250 2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 432...
output:
125432.9882
result:
ok found '125432.9882000', expected '125432.9881825', error '0.0000000'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
250 1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 319...
output:
116578.9931
result:
ok found '116578.9931000', expected '116578.9930612', error '0.0000000'
Test #20:
score: 0
Accepted
time: 2ms
memory: 3864kb
input:
250 2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 115...
output:
118802.7168
result:
ok found '118802.7168000', expected '118802.7168438', error '0.0000000'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3924kb
input:
3 4719 3755 2542
output:
2368.991349
result:
ok found '2368.9913490', expected '2368.9913490', error '0.0000000'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
3 5104 418 5498
output:
7931.549792
result:
ok found '7931.5497920', expected '7931.5497917', error '0.0000000'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
3 2670 3423 5104
output:
2776.819738
result:
ok found '2776.8197380', expected '2776.8197377', error '0.0000000'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
3 1797 4299 3474
output:
2222.975094
result:
ok found '2222.9750940', expected '2222.9750939', error '0.0000000'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
4 4719 3755 2542 1190
output:
2385.884483
result:
ok found '2385.8844830', expected '2385.8844829', error '0.0000000'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
4 2443 973 5013 5104
output:
2673.310105
result:
ok found '2673.3101050', expected '2673.3101042', error '0.0000000'
Test #27:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
4 1854 1474 3499 1575
output:
1762.718482
result:
ok found '1762.7184820', expected '1762.7184818', error '0.0000000'
Test #28:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
4 2682 1652 1797 4299
output:
2155.775073
result:
ok found '2155.7750730', expected '2155.7750725', error '0.0000000'
Test #29:
score: 0
Accepted
time: 3ms
memory: 3924kb
input:
500 4719 3755 2542 1190 5557 3641 5426 1578 5247 3181 3524 983 4151 4337 3004 2062 1048 4739 499 2530 1378 450 5459 651 1714 4051 416 4186 2598 1031 374 5523 4787 1122 4919 2549 4763 4345 2333 4009 5732 5857 3198 3882 2399 4409 4151 3447 1353 4650 4184 2731 3307 3642 3383 5021 5899 2005 3206 702 303...
output:
247805.3749
result:
ok found '247805.3749000', expected '247805.3748878', error '0.0000000'
Test #30:
score: 0
Accepted
time: 3ms
memory: 3856kb
input:
500 2443 973 5013 5104 418 5498 2436 5522 512 1539 3851 355 50 4167 3205 286 1171 5083 867 2208 2497 2455 3142 2247 1531 2986 862 5930 3449 4996 5201 5892 5969 4214 4995 4594 1917 5637 4115 2429 5383 171 990 5433 4338 4195 5720 5509 1483 4793 1716 2187 5454 3065 4434 984 4257 3503 5120 1705 2498 432...
output:
236689.3706
result:
ok found '236689.3706000', expected '236689.3706188', error '0.0000000'
Test #31:
score: 0
Accepted
time: 3ms
memory: 3848kb
input:
500 1854 1474 3499 1575 1422 3130 2402 5948 2378 2670 3423 5104 295 1663 475 66 2687 2978 4618 3027 90 5982 4390 5990 4343 4206 465 4394 2436 5904 3740 4290 5585 5445 4071 1006 2575 472 5161 3159 1348 2583 2262 1643 4247 944 5917 933 3922 4534 2166 2218 4515 555 2208 2857 2967 879 5457 5403 4989 319...
output:
240655.2317
result:
ok found '240655.2317000', expected '240655.2317000', error '0.0000000'
Test #32:
score: 0
Accepted
time: 3ms
memory: 3868kb
input:
500 2343 137 3849 255 2682 1652 1797 4299 3474 4549 3158 4921 4489 2138 1620 2009 4673 5285 355 2131 139 1855 3936 1840 4743 3946 5455 3742 1890 4475 95 2439 4613 2150 2694 5501 3803 4491 3800 1276 1245 5164 196 5734 1302 22 5950 4181 5307 304 311 5446 2159 2453 5493 5108 399 3153 2849 2289 1628 115...
output:
239234.4591
result:
ok found '239234.4591000', expected '239234.4590830', error '0.0000000'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
5 4719 3755 2542 1190 5557
output:
3171.259842
result:
ok found '3171.2598420', expected '3171.2598418', error '0.0000000'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
5 2443 973 5013 5104 418
output:
2706.461834
result:
ok found '2706.4618340', expected '2706.4618337', error '0.0000000'
Test #35:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
5 1854 1474 3499 1575 1422
output:
1804.046248
result:
ok found '1804.0462480', expected '1804.0462482', error '0.0000000'
Test #36:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
5 2343 137 3849 255 2682
output:
1926.485139
result:
ok found '1926.4851390', expected '1926.4851383', error '0.0000000'
Test #37:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
6 4719 3755 2542 1190 5557 3641
output:
3658.244185
result:
ok found '3658.2441850', expected '3658.2441848', error '0.0000000'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3792kb
input:
6 2443 973 5013 5104 418 5498
output:
3441.784945
result:
ok found '3441.7849450', expected '3441.7849447', error '0.0000000'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3864kb
input:
6 1854 1474 3499 1575 1422 3130
output:
2223.647331
result:
ok found '2223.6473310', expected '2223.6473306', error '0.0000000'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
6 2343 137 3849 255 2682 1652
output:
2013.752378
result:
ok found '2013.7523780', expected '2013.7523776', error '0.0000000'
Test #41:
score: 0
Accepted
time: 0ms
memory: 3860kb
input:
7 4719 3755 2542 1190 5557 3641 5426
output:
4485.567343
result:
ok found '4485.5673430', expected '4485.5673426', error '0.0000000'
Test #42:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
7 2443 973 5013 5104 418 5498 2436
output:
3760.180158
result:
ok found '3760.1801580', expected '3760.1801576', error '0.0000000'
Test #43:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
7 1854 1474 3499 1575 1422 3130 2402
output:
2569.838446
result:
ok found '2569.8384460', expected '2569.8384455', error '0.0000000'
Test #44:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
7 2343 137 3849 255 2682 1652 1797
output:
2218.938075
result:
ok found '2218.9380750', expected '2218.9380749', error '0.0000000'
Test #45:
score: -100
Wrong Answer
time: 0ms
memory: 3996kb
input:
3 3 4 5
output:
2.500000528
result:
wrong answer 1st numbers differ - expected: '2.5000000', found: '2.5000005', error = '0.0000002'