QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#137162 | #4403. Measures | patrik01 | 35 | 143ms | 5664kb | C++20 | 1.1kb | 2023-08-10 00:46:01 | 2023-08-10 00:46:02 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define i32 int
#define f64 double
#define F0R(i, n) for(int i = 0; i<n; i++)
#define FOR(i, s, e) for(int i = s; i<e; i++)
#define vec vector
i32 main() {
cout << setprecision(15);
i32 n, m;
f64 d;
cin >> n >> m >> d;
vec<i32> a(n);
vec<i32> b(m);
F0R(i, n) {
cin >> a[i];
}
sort(a.begin(), a.end());
f64 t = -1;
f64 lp = 0;
auto add = [&](f64 pos) {
if(t==-1) {
lp = pos;
t=0;
return;
}
if(pos >= lp + d) {
pos = max(lp+d, pos-t);
}
else if(pos+t >= lp+d) {
pos = lp+d;
}
else {
pos += t;
f64 offs = ((lp+d)-pos)/2;
pos += offs;
t += offs;
}
lp = pos;
};
F0R(i, n) {
add((f64) a[i]);
}
F0R(i, m) {
cin >> b[i];
}
vec<f64> ans(m);
F0R(i, m) {
add((f64) b[i]);
ans[i] = t;
}
F0R(i, m) {
cout << ans[i] << ' ';
}
cout << endl;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3772kb
input:
2000 10 1845 533219610 452539353 832124174 883897563 447321676 368976465 166536135 758380924 920827481 313174994 781707618 815047867 925081003 325012331 69086835 637564067 429273345 781597586 376641056 72157101 36547962 656170271 772458737 707141316 33546435 166034841 747620387 663158697 852912826 9...
output:
78190137.5 78190137.5 252303429 252303429 252303429 252303429 295312507.5 295312507.5 295312507.5 295312507.5
result:
wrong answer 1st lines differ - expected: '841.5 841.5 841.5 841.5 841.5 841.5 841.5 841.5 841.5 841.5', found: '78190137.5 78190137.5 25230342...2507.5 295312507.5 295312507.5 '
Subtask #2:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 53ms
memory: 4008kb
input:
200000 10 128 853561279 93820692 821887507 753094209 227461682 691969137 519378763 296675314 646705609 727762559 98496302 959430593 403972779 982596953 775241610 209602833 112152326 762927950 619981024 764326855 379819398 392809293 145648647 960106249 514225957 952027167 428472167 571874662 95085242...
output:
214791781 214791781 292019185 292019185 292019185 292019185 476913084.5 476913084.5 476913084.5 476913084.5
result:
wrong answer 1st lines differ - expected: '167 167 167 167 167 167 167 167 167 167', found: '214791781 214791781 292019185 ...3084.5 476913084.5 476913084.5 '
Subtask #3:
score: 35
Accepted
Test #17:
score: 35
Accepted
time: 94ms
memory: 5600kb
input:
0 200000 1289 3822 6378 8930 10621 14339 15484 27804 30714 47103 51268 51740 57420 74974 81161 81292 82797 84329 92397 96558 102781 108313 117355 117730 121011 121917 123170 124479 132083 144850 152609 153404 161406 162584 163062 172029 172074 172504 178451 185861 197247 197729 204944 223883 245287...
output:
0 0 0 0 0 72 72 72 72 72 408.5 408.5 408.5 408.5 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 579 622 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 1051.5 10...
result:
ok single line: '0 0 0 0 0 72 72 72 72 72 408.5... 3504 3504 3504 3504 3504 3504 '
Test #18:
score: 0
Accepted
time: 135ms
memory: 5580kb
input:
0 200000 48068360 679 10651 18144 30601 32757 43159 49686 50125 51177 56809 58075 58226 58958 73050 94444 103453 106057 111073 122659 124138 128709 129385 131348 133922 141249 142821 143624 147761 150281 162176 163034 172312 178736 179449 181052 182053 201110 207960 209076 209076 210284 211670 2137...
output:
0 24029194 48059627.5 72087579 96120681 120149660 144180576.5 168214537 192248191 216279555 240313102 264347206.5 288381020.5 312408154.5 336431637.5 360461313 384494191 408525863 432554250 456587690.5 480619585 504653427 528686625.5 552719518.5 576750035 600783429 624817207.5 648849319 672882239 69...
result:
ok single line: '0 24029194 48059627.5 72087579....5 4806287936053 4806311967223 '
Test #19:
score: 0
Accepted
time: 141ms
memory: 5592kb
input:
0 200000 24859689 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 965671178 9...
output:
0 12429844.5 24859689 37289533.5 49719378 62149222.5 74579067 87008911.5 99438756 111868600.5 124298445 136728289.5 149158134 161587978.5 174017823 186447667.5 198877512 211307356.5 223737201 236167045.5 248596890 261026734.5 273456579 285886423.5 298316268 310746112.5 323175957 335605801.5 34803564...
result:
ok single line: '0 12429844.5 24859689 37289533... 2485944040311 2485956470155.5 '
Test #20:
score: 0
Accepted
time: 102ms
memory: 5612kb
input:
0 200000 138 5098 7009 9693 16728 19599 20167 21976 26785 27949 31284 37717 39888 41868 48206 48660 60696 61788 76512 76709 84048 91636 92160 95532 98076 98091 98696 101235 103776 109176 109529 112067 112296 112639 114045 115969 119044 125968 126157 134907 135025 135100 135823 143449 144850 146749 ...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61.5 61...
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...29 129 129 129 129 129 129 129 '
Test #21:
score: 0
Accepted
time: 126ms
memory: 5580kb
input:
0 200000 8932 1 5615 6754 8348 8933 12311 17865 21154 26797 32273 35729 44661 53593 57323 62525 71457 80389 80440 86190 89321 92508 98253 107185 116117 118351 125049 133981 134837 141246 142913 150437 151845 159148 159854 160777 163034 169709 169940 178641 187573 191176 194196 196505 197448 201103 ...
output:
0 1659 5555.5 9224.5 13398 16175 17864 20685.5 22330 24058 26796 26796 26796 29397 31262 31262 31262 35702.5 37293.5 40194 43066.5 44660 44660 44660 48009 49126 49126 53164 54425.5 58058 58762 62524 63338.5 67451.5 71456 74793.5 75922 80272.5 80388 80388 83052.5 86008.5 89320 93314.5 95953 98252 982...
result:
ok single line: '0 1659 5555.5 9224.5 13398 161...7248.5 399047248.5 399047248.5 '
Test #22:
score: 0
Accepted
time: 76ms
memory: 5592kb
input:
0 200000 911 1 4153 4636 6716 8684 9594 11734 15761 20650 20900 21492 24692 25722 27777 30797 35537 35641 36014 39098 39626 42604 46740 51413 51565 55145 59189 61555 65067 67089 68483 71099 74765 79580 82960 85782 90118 92220 92310 92594 92730 95647 96047 100743 102095 106337 109762 109945 110016 1...
output:
0 0 214 214 214 214 214 214 214 330.5 490 490 490 490 490 490 490 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 672.5 724 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5 1111.5...
result:
ok single line: '0 0 214 214 214 214 214 214 21... 2355 2355 2355 2355 2355 2355 '
Test #23:
score: 0
Accepted
time: 125ms
memory: 5664kb
input:
0 200000 5961 72 5442 5978 11445 11958 17394 17942 23383 23853 29331 29840 35264 35801 41238 41756 47181 47758 53185 53723 59112 59643 65112 65605 71039 71590 77035 77502 82942 83499 88965 89431 94914 95436 100856 101354 106839 107367 112749 113309 118711 119224 124712 125256 130647 131147 136625 1...
output:
0 295.5 3008 3255 5979 6241.5 8948 9208 11953.5 12195 14921 15189.5 17901.5 18163.5 20885 21153 23845 24112 26823.5 27109.5 29824.5 30070.5 32804.5 33068 35773 36031 38778 39038.5 41740.5 41988 44735.5 44974.5 47694 47964.5 50696 50934 53650.5 53940 56640.5 56920 59644 59880.5 62589 62874 65604.5 65...
result:
ok single line: '0 295.5 3008 3255 5979 6241.5 ...097316.5 96097316.5 96097316.5 '
Test #24:
score: 0
Accepted
time: 89ms
memory: 5580kb
input:
0 200000 58 14651 38496 47458 51972 53850 56749 56924 58253 63063 65850 68323 70055 75302 77503 81134 85785 86256 87784 94463 94906 102173 105358 126386 128313 128502 133848 137268 154149 168676 170338 171190 175942 178409 184121 202476 205553 209634 211855 213558 231588 236756 243257 243502 249717...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 6....
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 53.5 53.5 53.5 53.5 53.5 53.5 '
Test #25:
score: 0
Accepted
time: 95ms
memory: 5596kb
input:
0 200000 7 680 5842 9451 10238 22620 23699 24905 59460 63570 66196 68700 71008 73394 85862 103521 109721 113509 117227 121727 123411 128249 128352 137911 138247 138293 142234 143749 147003 150171 159495 165975 176228 177902 188317 201910 206726 210934 213957 218536 219380 224660 226205 231917 23214...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 '
Test #26:
score: 0
Accepted
time: 143ms
memory: 5576kb
input:
0 200000 1000000000 1497 1745 2660 8061 22152 22405 30629 43491 43846 46983 50712 50902 58652 61094 66738 73005 73564 93934 93965 109138 131602 141681 156975 164653 168415 173673 175065 179344 195181 206687 216847 219595 221227 222232 227915 231858 232249 240842 241360 249381 250140 256638 257578 2...
output:
0 499999876 999999418.5 1499996718 1999989672.5 2499989546 2999985434 3499979003 3999978825.5 4499977257 4999975392.5 5499975297.5 5999971422.5 6499970201.5 6999967379.5 7499964246 7999963966.5 8499953781.5 8999953766 9499946179.5 9999934947.5 10499929908 10999922261 11499918422 11999916541 12499913...
result:
ok single line: '0 499999876 999999418.5 149999...9998500001775 99999000001564.5 '
Test #27:
score: 0
Accepted
time: 111ms
memory: 5648kb
input:
0 200000 480 169 196 225 256 289 324 361 400 441 484 529 576 625 676 729 784 841 900 961 1024 1089 1156 1225 1296 1369 1444 1521 1600 1681 1764 1849 1936 2025 2116 2209 2304 2401 2500 2601 2704 2809 2916 3025 3136 3249 3364 3481 3600 3721 3844 3969 4096 4225 4356 4489 4624 4761 4900 5041 5184 5329 ...
output:
0 226.5 452 676.5 900 1122.5 1344 1564.5 1784 2002.5 2220 2436.5 2652 2866.5 3080 3292.5 3504 3714.5 3924 4132.5 4340 4546.5 4752 4956.5 5160 5362.5 5564 5764.5 5964 6162.5 6360 6556.5 6752 6946.5 7140 7332.5 7524 7714.5 7904 8092.5 8280 8466.5 8652 8836.5 9020 9202.5 9384 9564.5 9744 9922.5 10100 1...
result:
ok single line: '0 226.5 452 676.5 900 1122.5 1...9164.5 29164.5 29164.5 29164.5 '
Test #28:
score: 0
Accepted
time: 140ms
memory: 5592kb
input:
0 200000 468527 2171 3517 16152 17860 19696 22254 24648 31391 35003 38442 39637 57482 60327 71129 80334 87223 92846 103437 107654 107768 109898 112173 114705 118218 123930 125434 127758 134102 140089 140619 149535 152577 155359 167828 168010 169682 179747 189768 195487 204395 208014 209051 211790 2...
output:
0 233590.5 461536.5 694946 928291.5 1161276 1394342.5 1625234.5 1857692 2090236 2323902 2549243 2782084 3010946.5 3240607.5 3471426.5 3702878.5 3931846.5 4164001.5 4398208 4631406.5 4864532.5 5097530 5330037 5561444.5 5794956 6028057.5 6259149 6490419 6724417.5 6954223 7186965.5 7419838 7647867 7882...
result:
ok single line: '0 233590.5 461536.5 694946 928...5402 46352237231.5 46352469200 '
Test #29:
score: 0
Accepted
time: 103ms
memory: 5596kb
input:
0 200000 13 228 5536 6312 7481 16824 19821 27775 28367 30494 30841 30961 34792 37869 39039 40220 44308 47706 48432 51216 58074 58788 59549 61799 65913 70620 72179 80848 83349 84154 90030 91335 93268 97603 107154 107168 112800 116848 118024 123761 124515 127896 133752 134287 135888 146404 151329 155...
output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...
result:
ok single line: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ....5 6.5 6.5 6.5 6.5 6.5 6.5 6.5 '
Test #30:
score: 0
Accepted
time: 135ms
memory: 5572kb
input:
0 200000 13485030 3280 8052 9292 9769 11736 11792 16317 26853 35150 37235 37989 40601 43903 56672 58499 61921 62649 63800 66360 72872 74868 82132 94921 96068 97532 100898 108936 109290 112264 113575 118209 119647 119724 120527 123343 138103 142142 144928 151856 153878 157955 165055 166098 169147 16...
output:
0 6740129 13482024 20224300.5 26965832 33708319 40448571.5 47185818.5 53924185 60665657.5 67407795.5 74149004.5 80889868.5 87625999 94367600.5 101108404.5 107850555.5 114592495 121333730 128072989 134814506 141553389 148289509.5 155031451 161773234 168514066 175252562 181994900 188735928 195477787.5...
result:
ok single line: '0 6740129 13482024 20224300.5 ... 1347989522986 1347996264660.5 '
Test #31:
score: 0
Accepted
time: 135ms
memory: 5584kb
input:
0 200000 911395 1 1053 2048 5442 6521 7139 11475 13111 15548 15820 17560 21894 25090 26510 30206 33226 36170 40735 42650 43830 48316 51788 54028 57166 59682 60774 62896 63736 66916 71502 76254 77446 79346 81170 83478 84514 88834 92114 96664 100098 102474 104864 104952 107912 108936 112669 113817 11...
output:
0 455171.5 910371.5 1364372 1819530 2274918.5 2728448 3183327.5 3637806.5 4093368 4548195.5 5001726 5455825.5 5910813 6364662.5 6818850 7273075.5 7726490.5 8181230.5 8636338 9089792.5 9543754 9998331.5 10452460 10906899.5 11362051 11816687.5 12271965 12726072.5 13179477 13632798.5 14087900 14542647....
result:
ok single line: '0 455171.5 910371.5 1364372 18...6886 90638590543.5 90639044303 '
Test #32:
score: 0
Accepted
time: 93ms
memory: 5544kb
input:
0 200000 20 3 24 44 64 84 104 124 142 161 184 203 221 241 264 281 303 323 341 361 383 401 421 441 463 483 502 521 542 564 584 603 623 643 663 682 702 722 741 763 782 804 822 843 861 881 903 923 943 963 983 1001 1023 1043 1061 1081 1101 1123 1142 1162 1182 1201 1224 1244 1264 1282 1301 1321 1343 136...
output:
0 0 0 0 0 0 0 1 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 ...
result:
ok single line: '0 0 0 0 0 0 0 1 1.5 1.5 1.5 1.....5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 '
Test #33:
score: 0
Accepted
time: 123ms
memory: 5616kb
input:
0 200000 13824 5098 7009 9693 16728 19599 20167 21976 26785 27949 31284 37717 39888 41868 48206 48660 60696 61788 76512 76709 84048 91636 92160 95532 98076 98091 98696 101235 103776 109176 109529 112067 112296 112639 114045 115969 119044 125968 126157 134907 135025 135100 135823 143449 144850 14674...
output:
0 5956.5 11526.5 14921 20397.5 27025.5 33033 37540.5 43870.5 49115 52810.5 58637 64559 68302 74987 75881 82247 82247 88610.5 91853 94971 101621 106847 112487 119391.5 126001 131643.5 137285 141497 148232.5 153875.5 160673 167413.5 173622.5 179572.5 184947 188397 195214.5 197751.5 204604.5 211479 218...
result:
ok single line: '0 5956.5 11526.5 14921 20397.5... 882395312 882398780 882400061 '
Subtask #4:
score: 0
Wrong Answer
Test #34:
score: 0
Wrong Answer
time: 118ms
memory: 5564kb
input:
0 200000 1289 582772771 851704216 915624354 601264573 510202549 844706968 795870015 897865316 665295826 172582259 59358299 239645315 343442424 973625659 840972987 546781500 897704802 602265737 968590815 561687707 728916679 417806750 143659623 620408739 86393298 403049850 578760184 735385586 7656173...
output:
0 0 0 157180535 202712191.5 202712191.5 202712191.5 202712191.5 202712191.5 371525559 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 428138183.5 443623270 443623270 443623270 443623270 443623...
result:
wrong answer 1st lines differ - expected: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...1.5 3071.5 3071.5 3071.5 3071.5', found: '0 0 0 157180535 202712191.5 20...5254.5 627915254.5 627915254.5 '