QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#734965 | #4590. Happy Travelling | std_abs# | AC ✓ | 123ms | 82692kb | C++20 | 2.4kb | 2024-11-11 16:18:51 | 2024-11-11 16:18:51 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(a) ((int)a.size())
const int mod = 998244353, N = 100005, K = 1000;
deque<pair<ll, int>> dq;
priority_queue<pair<ll, int>> pq[K];
vector<pair<ll, int>> eve[N];
ll n, k, d;
int t[N];
void insert_dq(ll x, int i) {
for (int j = i; j + k - 1 <= i + t[i]; j += k, x += d)
eve[j].pb(pii(x, j + k - 1));
}
void upd_dq(int now) {
for (auto [x, y] : eve[now]) {
while (!dq.empty() && dq.back().first <= x)
dq.pop_back();
dq.emplace_back(x, y);
}
while (!dq.empty() && dq.front().second <= now)
dq.pop_front();
for (auto [x, y] : eve[now + 1]) {
while (!dq.empty() && dq.back().first <= x)
dq.pop_back();
dq.emplace_back(x, y);
}
}
ll get_dq() {
return dq.empty() ? -1ll << 40 : dq.front().first;
}
void insert_pq(int id, ll x, int i) {
pq[id].push(pii(x, i + t[i]));
}
ll get_pq(int id, int now) {
while (!pq[id].empty() && pq[id].top().second < now)
pq[id].pop();
return pq[id].empty() ? -1ll << 40 : pq[id].top().first;
}
int h[N];
int main() {
ios::sync_with_stdio(false), cin.tie(0);
cin >> n >> k >> d;
d *= -1;
for (int i = 0; i < n; ++i)
cin >> h[i];
for (int i = 0; i < n - 1; ++i)
cin >> t[i];
if (k > K) {
ll dp = h[0];
insert_dq(dp, 0);
upd_dq(0);
insert_pq(0, dp + t[0] / k * d, 0);
for (int i = 1; i < n; ++i) {
dp = max(get_dq() + h[i], get_pq(0, i) + h[i]);
if (i == n - 1)
break;
insert_dq(dp, i);
upd_dq(i);
insert_pq(0, dp + t[i] / k * d, i);
}
cout << dp << '\n';
}
else {
ll dp = h[0];
insert_pq(0, dp, 0);
for (int i = 1; i < n; ++i) {
dp = -1ll << 40;
for (int j = 0; j < k; ++j) {
dp = max(dp, get_pq(j, i) + (i - j) / k * d + h[i]);
//cout << "D" << j << ' ' << dp << '\n';
}
//cout << i << ' ' << dp << '\n';
if (i == n - 1)
break;
insert_pq(i % k, dp - i / k * d, i);
}
cout << dp << '\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3660kb
input:
6 2 1 8 -7 -8 9 0 2 5 3 3 2 1
output:
18
result:
ok single line: '18'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5668kb
input:
8 8 8 10 -5 -5 -5 -5 -5 -5 10 5 2 5 3 2 1 1
output:
15
result:
ok single line: '15'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
13 2 2 -5 -4 -4 -1 7 -6 -5 -4 -3 -2 -1 5 -7 3 10 9 8 7 6 5 4 3 2 1 1
output:
-9
result:
ok single line: '-9'
Test #4:
score: 0
Accepted
time: 0ms
memory: 5636kb
input:
2 1 0 -10000 10000 1
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 10ms
memory: 5960kb
input:
98987 4 3 -8225 -8961 -5537 -5621 -8143 -5214 -5538 -6912 -6601 -8839 -7872 -7867 -9553 -9793 -7333 -7360 -5820 -7459 -8824 -9716 -9757 -5846 -5300 -5912 -7953 -8360 -7609 -5937 -5525 -9748 -7326 -8311 -9979 -9292 -8542 -7589 -7939 -5914 -7985 -9999 -9212 -8274 -8084 -6620 -5991 -7826 -6327 -5228 -6...
output:
-84108
result:
ok single line: '-84108'
Test #6:
score: 0
Accepted
time: 13ms
memory: 5852kb
input:
98467 2 3 -5677 -9080 -6665 -5838 -5755 -8938 -6286 -5160 -7147 -8370 -8214 -6088 -9763 -5183 -7123 -7264 -5298 -8855 -6381 -6592 -9216 -8429 -9598 -7443 -7393 -8712 -5545 -6778 -6010 -5717 -9102 -7968 -6140 -9592 -7917 -5217 -5015 -7798 -9339 -5678 -7073 -7607 -7961 -6185 -9941 -6421 -8779 -5388 -8...
output:
-150169
result:
ok single line: '-150169'
Test #7:
score: 0
Accepted
time: 13ms
memory: 7808kb
input:
96173 2 1 -6463 -9099 -6269 -6169 -8273 -9839 -9929 -5447 -5908 -6884 -6908 -8359 -6477 -9414 -9207 -8180 -6264 -9293 -8981 -6557 -9260 -9700 -6785 -7121 -8382 -9712 -5178 -5821 -9107 -9004 -7472 -9306 -9311 -7160 -7965 -5394 -8048 -7415 -5233 -7746 -7390 -5298 -7721 -7915 -9646 -5371 -5712 -6234 -5...
output:
-45780
result:
ok single line: '-45780'
Test #8:
score: 0
Accepted
time: 14ms
memory: 7836kb
input:
96905 1 1 -7933 -5685 -6201 -5415 -7294 -9904 -8968 -8433 -6287 -6727 -5933 -5418 -8953 -6743 -7057 -7087 -7244 -5302 -5130 -8934 -5053 -9811 -8695 -5989 -7785 -5991 -8351 -9463 -7037 -8867 -8956 -8194 -5272 -6270 -7737 -7793 -8851 -5839 -5178 -7009 -8018 -7375 -6091 -9226 -7117 -9522 -9248 -6036 -8...
output:
-72336
result:
ok single line: '-72336'
Test #9:
score: 0
Accepted
time: 13ms
memory: 7620kb
input:
97070 2 1 -6843 -9736 -7145 -9801 -6733 -7807 -8835 -5776 -6971 -7101 -8428 -7429 -9250 -9405 -6152 -7904 -5761 -8347 -6597 -8875 -8741 -7759 -8905 -9136 -8820 -9272 -9124 -6384 -7302 -5351 -8660 -5499 -9551 -9598 -9332 -7226 -5354 -9753 -7657 -5512 -7806 -5845 -5320 -9052 -8654 -9068 -5744 -7548 -7...
output:
-52581
result:
ok single line: '-52581'
Test #10:
score: 0
Accepted
time: 13ms
memory: 6168kb
input:
95643 95643 0 -5396 -7667 -7724 -8395 -5929 -5814 -6879 -7612 -6487 -5657 -6266 -7551 -8950 -6584 -5148 -7025 -7570 -6296 -6031 -7598 -5852 -5859 -7943 -6304 -6896 -5652 -9303 -5869 -9073 -6843 -7438 -6428 -8896 -5239 -7793 -6730 -7331 -7202 -8118 -9344 -8450 -8315 -8402 -8705 -5246 -9043 -7347 -872...
output:
-13774
result:
ok single line: '-13774'
Test #11:
score: 0
Accepted
time: 14ms
memory: 6096kb
input:
100000 99999 476 -109 -1014 -1404 -1837 -712 -1500 -1760 -751 184 -333 -860 -418 -1676 -1499 -1506 -456 -1692 -1473 -1872 -1523 -599 461 -583 -1685 -94 121 53 -385 192 -562 -1169 220 366 -746 -584 -1395 325 -502 98 -1773 -293 -72 -1894 -449 416 -1001 -1350 -1842 -1279 -528 323 -1196 32 -83 -1112 410...
output:
4735350
result:
ok single line: '4735350'
Test #12:
score: 0
Accepted
time: 40ms
memory: 5956kb
input:
93009 101 191 -278 -103 -706 -686 -521 -375 -330 -183 -381 -91 -686 -683 -89 -448 -724 -71 -374 -470 -214 -475 -505 -599 -108 -157 -199 -541 -509 -477 -62 -96 -415 -49 -524 -93 -230 -745 -561 -47 -451 -165 -763 -461 -357 -555 -757 -52 -246 -297 -145 -599 -36 -366 -157 -200 -38 -344 -105 -509 -54 -41...
output:
1532
result:
ok single line: '1532'
Test #13:
score: 0
Accepted
time: 108ms
memory: 6804kb
input:
97621 313 252 -459 -973 -853 -287 -579 -817 -629 -187 -509 -814 -628 -742 -369 -503 -519 -213 -393 -708 -776 -222 -147 -760 -558 -926 -439 -437 -729 -16 -932 -964 -508 -809 -434 -186 -440 -142 -828 -11 -521 -282 -718 -976 -832 -760 -574 -461 -432 -219 -182 -2 -27 -638 -598 -800 -907 -510 -127 -429 -...
output:
3749
result:
ok single line: '3749'
Test #14:
score: 0
Accepted
time: 97ms
memory: 5876kb
input:
95287 250 112 -46 -248 -159 -372 -271 -352 -296 -31 -3 -397 -32 -73 -276 -443 -246 -236 -265 -102 -435 -398 -211 -376 -78 -277 -272 -446 -54 -345 -89 -73 -286 -210 -79 -424 -171 -260 -45 -341 -257 -300 -301 -19 4 -52 -223 -280 1 -99 -88 -143 -433 -72 -46 -333 -189 -115 -147 -401 -73 -365 -398 -152 -...
output:
9254
result:
ok single line: '9254'
Test #15:
score: 0
Accepted
time: 1ms
memory: 5672kb
input:
7 7 10000 7 3 -1 -6 3 4 1 6 5 4 3 2 1
output:
18
result:
ok single line: '18'
Test #16:
score: 0
Accepted
time: 15ms
memory: 10704kb
input:
93094 1415 354 -362 -297 12 34 -37 -924 265 -34 -835 -884 -245 -323 -856 -1166 -386 -642 288 -92 -275 -446 -121 -1345 -126 -13 -1378 -442 -24 -479 171 256 -582 -223 -65 -1114 -614 -197 -862 -552 -908 -718 -489 -585 -1148 -356 322 276 -252 -1295 104 86 332 -918 -1407 -1393 -336 -413 -1186 -1348 -435 ...
output:
3296610
result:
ok single line: '3296610'
Test #17:
score: 0
Accepted
time: 14ms
memory: 9096kb
input:
93543 1224 505 370 58 -1403 -1253 184 -2011 -1632 -1565 -978 -1908 -923 270 96 -1851 -897 -1278 -780 -957 -1674 -68 390 -256 -335 -977 -470 -1412 364 -1737 -951 336 -1487 -1266 -1326 400 -1748 -134 -1626 -1400 -163 226 4 -1401 -346 -1168 -1094 391 -1285 -701 -1550 -1443 343 -580 -1836 -1717 306 -161...
output:
4722004
result:
ok single line: '4722004'
Test #18:
score: 0
Accepted
time: 13ms
memory: 9180kb
input:
97347 39394 566 481 -427 -858 -726 -1285 -1337 -1253 -1080 -1990 -773 -1921 -1616 -463 310 -1447 -106 -1377 -2061 -565 -1444 -1412 353 -973 -1891 231 -70 -962 40 -1746 -1315 -1653 -4 375 -1719 464 238 -1516 -1331 -1244 -144 -1660 -1814 -179 -2150 -374 -113 -1578 -146 -131 -1946 -558 -222 -1253 -1308...
output:
5535209
result:
ok single line: '5535209'
Test #19:
score: 0
Accepted
time: 10ms
memory: 8176kb
input:
90834 53418 728 -9217 -6814 2547 -12 -6989 -1516 7814 159 -7793 -5319 6381 -904 3222 3010 -8266 -3940 1083 1871 -7986 4337 5752 3998 -6748 9530 2165 798 7563 -8385 -6673 2314 -6850 -6010 -4575 -319 -3432 -6025 500 -8768 -9599 9413 6230 -6120 6854 8981 1721 9406 -3615 5754 -3131 -601 -9062 -7899 5998...
output:
228261947
result:
ok single line: '228261947'
Test #20:
score: 0
Accepted
time: 54ms
memory: 8388kb
input:
95214 148 40 -43 -150 -132 -67 -130 -16 -50 -139 -90 -23 -110 -85 3 -5 -2 -48 -73 -154 -74 -12 -37 -15 -21 -14 1 -86 -121 -91 -17 -13 -5 -21 -90 -124 -75 -115 -150 -81 -125 -72 -3 -99 -77 4 -136 -36 -58 -117 -131 -33 -43 -85 -8 -22 -128 -100 -68 -160 -20 -160 -92 -27 -53 -88 -125 -88 -147 -75 -12 -2...
output:
5623
result:
ok single line: '5623'
Test #21:
score: 0
Accepted
time: 110ms
memory: 6944kb
input:
99909 317 446 -76 -1003 -1280 -512 -1456 -776 -80 -43 -1389 -462 -458 -784 -819 -1732 -369 -1395 -1570 -1722 -103 -877 -897 -742 -1191 -524 -1060 -988 -266 -1269 -812 -1246 -1321 -375 -273 -35 -359 -201 -731 -553 -470 -1276 -1522 -597 -1257 -1208 -133 -961 -1466 -218 -720 -1190 -999 -720 -1443 -1383...
output:
1522
result:
ok single line: '1522'
Test #22:
score: 0
Accepted
time: 110ms
memory: 4308kb
input:
92058 306 267 -381 -715 -880 -34 -5 -312 -316 -91 -742 -383 -539 -917 -92 -595 -509 -905 -536 -555 -449 -432 -713 -248 -457 -525 -837 -561 -908 -943 -305 -420 -495 -461 -1062 -856 -706 -1016 -456 -335 -803 -726 -795 -434 -473 -152 -674 -1062 -841 -711 -726 -468 -11 -509 -61 -27 -698 -166 -263 -742 -...
output:
560
result:
ok single line: '560'
Test #23:
score: 0
Accepted
time: 15ms
memory: 10676kb
input:
94369 1373 587 -1904 -1621 -793 -829 -2011 -599 -1367 -571 76 -1049 -813 -1300 -1195 85 -917 -658 -1367 553 -1492 -1145 -1371 -136 -1234 -179 -2348 -844 -895 -2063 -785 -357 -145 -2232 243 -1963 -1232 -2271 -1701 -844 -937 -772 515 510 -1322 -978 467 -830 -2024 -2146 -2246 -436 -1610 473 -647 72 -14...
output:
5541089
result:
ok single line: '5541089'
Test #24:
score: 0
Accepted
time: 15ms
memory: 9208kb
input:
97084 1193 347 -221 -923 -428 -1360 -1087 167 -586 -1304 -154 -523 289 -454 -1315 -787 -621 -36 -1074 -1200 -974 -1024 -824 -445 -980 -844 -78 -1030 -1342 -336 -452 -1341 67 -835 225 -1080 -268 -147 -983 -748 -508 -96 223 -984 -873 -1030 -325 -1162 -1083 -82 -1272 -695 323 -1277 292 268 -1082 -1140 ...
output:
3343916
result:
ok single line: '3343916'
Test #25:
score: 0
Accepted
time: 16ms
memory: 9012kb
input:
96623 48663 409 -483 -1205 -1198 -188 -799 -770 28 -447 -229 -2 -1351 -561 -31 264 177 -110 -484 -1122 -1540 311 -977 105 -169 -1409 -1474 -1029 44 -801 -1526 193 -1134 -757 -1565 187 -533 -1525 -106 -497 -1089 286 -1497 -717 -234 -1444 -1407 -412 -634 369 -130 -268 160 -1218 -1122 -307 -918 -1315 -...
output:
3958603
result:
ok single line: '3958603'
Test #26:
score: 0
Accepted
time: 9ms
memory: 4380kb
input:
100000 1 10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -10000 -1000...
output:
-1999990000
result:
ok single line: '-1999990000'
Test #27:
score: 0
Accepted
time: 7ms
memory: 6444kb
input:
94156 84951 5068 -3005 -1107 1153 -8918 -9519 -7802 -7782 -4688 9999 1858 4138 -6843 4602 5972 9866 -1258 -5769 6357 713 330 9831 1184 -5457 -9635 6084 -3303 7233 -4813 -3815 -3095 5054 3548 6333 6960 3708 8462 -7137 7580 -1519 -8383 -5012 4831 9876 4820 -4819 9163 6027 -3685 1102 -2104 -3064 6455 9...
output:
236737272
result:
ok single line: '236737272'
Test #28:
score: 0
Accepted
time: 11ms
memory: 7772kb
input:
92625 92625 3519 -2856 -7698 -3285 -813 -5507 4605 8264 2724 4383 -6498 1794 9100 -5232 -8879 -9297 2984 -3384 6636 -280 680 6457 -1788 -1959 9106 -3184 2827 6654 -4250 914 7931 3651 -1428 247 5100 -1823 6257 -3997 -6099 -3558 -3510 393 4321 -4272 -7543 -1462 2266 -9347 -6095 8386 -3191 7415 7413 -2...
output:
231452858
result:
ok single line: '231452858'
Test #29:
score: 0
Accepted
time: 123ms
memory: 82692kb
input:
94377 1011 469 -1414 -1146 -1588 -315 -1184 -780 397 -1415 -604 -461 261 -647 -439 -1421 -219 -52 -899 -387 192 -852 -731 -263 403 -1311 -953 -717 -133 -1408 -1472 -1552 175 -1399 -1831 190 -1581 376 -184 -1102 -1811 322 -375 -1446 352 -1221 -433 -1649 215 -1463 -1298 366 -360 -1105 416 163 -734 -28...
output:
4411516
result:
ok single line: '4411516'
Test #30:
score: 0
Accepted
time: 12ms
memory: 7844kb
input:
93868 46934 77 -265 31 -304 37 -163 58 -34 -129 -210 -260 -151 -73 -170 75 -117 5 -162 -88 -270 -246 -52 0 57 -280 -165 -38 -307 -261 48 -157 -301 24 -214 -161 -229 22 -127 -272 -241 -252 3 -61 -49 -285 -69 35 -104 -45 -133 -42 -111 -141 -58 -289 -133 29 -106 -79 -112 -211 -106 -280 -259 -38 -75 -19...
output:
731521
result:
ok single line: '731521'
Test #31:
score: 0
Accepted
time: 54ms
memory: 8396kb
input:
100000 137 197 -603 -342 -166 -58 -145 -371 -8 -491 -254 -292 -522 -549 -325 -695 -520 -308 -547 -112 -278 -206 -77 -483 -232 -9 -727 -365 -692 -59 -638 -410 -4 -346 -451 -663 -225 -202 -655 -776 -736 -30 -676 -22 -761 -388 -114 -156 -531 -648 -404 -508 -215 -623 -280 -765 -527 -298 -412 -475 -433 -...
output:
3483
result:
ok single line: '3483'
Test #32:
score: 0
Accepted
time: 105ms
memory: 4448kb
input:
100000 275 330 -1023 -544 -741 -1303 -644 -508 -1053 -857 -1302 -791 -113 -701 -893 -858 -742 9 -870 -1276 -375 -717 -133 -1265 -331 -114 -471 -607 -1013 -474 3 -465 -631 -334 -702 -1098 -822 -830 -575 -587 -286 -430 -735 -695 -420 -564 -820 -1041 -1268 -674 -1059 -1283 -714 -284 -695 -33 -80 -510 -...
output:
-2866
result:
ok single line: '-2866'
Test #33:
score: 0
Accepted
time: 16ms
memory: 10864kb
input:
100000 1539 594 -1017 -832 -461 56 -2059 -450 -796 -2130 -2152 -823 -1187 -190 -911 91 -503 -993 -2010 -373 -1540 -1460 -1218 -2275 -2226 -2226 -1078 -251 -217 -2234 60 -1937 -2375 -2187 -2045 -109 -320 -414 -825 -2104 593 95 -113 -1260 -229 -544 -856 -2010 -676 -2118 -1877 392 -1220 -1033 -1284 -92...
output:
5946941
result:
ok single line: '5946941'
Test #34:
score: 0
Accepted
time: 15ms
memory: 10888kb
input:
100000 1357 578 -1362 -1909 -466 431 -2104 -95 -88 -1595 -1013 -1837 -1040 -1122 -687 -996 324 -270 -1385 -37 -1766 -1884 422 -2025 -1026 46 513 526 -1753 -281 389 164 542 385 -161 -1960 -1104 504 -1227 -1027 387 -243 -74 -1399 524 -1617 -893 -1695 -909 130 -1690 138 -1745 -1836 -2058 -1202 -1548 -2...
output:
5817931
result:
ok single line: '5817931'
Test #35:
score: 0
Accepted
time: 15ms
memory: 9352kb
input:
100000 1332 413 -876 -138 -861 194 -1122 -475 -501 -1037 -1160 -1646 -1381 -1286 -1127 -1048 -1054 -372 -1521 121 -1258 -534 -1032 -572 -306 -1107 263 361 12 227 -1305 -164 -1287 -765 -209 -504 -961 -344 -1107 -364 -126 296 -1162 -798 -924 -325 -267 38 -1352 -101 -1121 320 -575 -1492 -589 -465 -1619...
output:
4079625
result:
ok single line: '4079625'
Test #36:
score: 0
Accepted
time: 12ms
memory: 9568kb
input:
100000 50000 305 -669 -448 -1069 -1000 -129 -1169 -459 -1161 -708 -1104 -647 -1142 -536 -1189 -1152 -1004 -825 -94 -1174 -841 -822 -1189 -259 -332 -687 -1063 -132 -1170 -840 -361 -937 -1017 -43 -24 -664 -563 -814 -151 -443 -823 -360 -495 -751 -1003 -824 -1152 -396 -105 -69 -1071 -56 -559 -1211 -625 ...
output:
3803
result:
ok single line: '3803'
Test #37:
score: 0
Accepted
time: 14ms
memory: 5904kb
input:
100000 2 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 10000 100...
output:
1000000000
result:
ok single line: '1000000000'
Test #38:
score: 0
Accepted
time: 13ms
memory: 6024kb
input:
100000 100000 150 -81 -181 -463 -262 -4 -132 -278 -233 -392 -245 -6 -462 -539 -365 -598 -265 -563 -462 -275 -581 -458 -502 -271 -371 -415 -207 -406 -317 -270 -178 -388 -11 -203 -107 -244 -521 -129 -189 -477 -505 -84 -325 -504 -158 -194 -52 -63 -187 -370 -315 6 -551 -39 -388 -535 -284 -406 -120 -345 ...
output:
8128
result:
ok single line: '8128'
Test #39:
score: 0
Accepted
time: 56ms
memory: 7768kb
input:
97502 138 398 -382 -273 -1171 -570 -291 -1452 -683 -740 -858 -47 -1384 -336 -1084 -1044 -1038 -56 -1514 -1148 -52 -1347 -51 -1519 -1416 -62 -1050 -241 -692 -621 -815 -608 -690 -1516 -217 -1054 -290 -1389 -937 -993 -757 -1046 -1291 -1536 -864 -415 -374 -763 -1188 -1363 -1200 -664 0 -514 -1231 -1511 -...
output:
-11626
result:
ok single line: '-11626'
Test #40:
score: 0
Accepted
time: 15ms
memory: 7728kb
input:
98451 6 9537 -1643 -9398 -4117 -3974 -3238 -9649 -6244 -9964 -773 -3724 -6715 -6459 -7301 -2046 -6160 -311 -5860 -7005 -2536 -9763 -8607 -2112 -6593 -5486 -646 -1638 -3919 -934 -6160 -5549 -5613 -8157 -5539 -1239 -7794 -3257 -6951 -5716 -7289 -6662 -6608 -9272 -4614 48 -4247 -7700 -1768 -7432 -1213 ...
output:
-49652554
result:
ok single line: '-49652554'
Test #41:
score: 0
Accepted
time: 13ms
memory: 6040kb
input:
97637 1 5004 8174 8415 6138 4030 4654 5961 618 4050 451 2609 3756 2220 497 3683 6708 8355 9174 575 724 1207 6654 6601 9850 5609 5698 3330 3749 9463 2071 5352 5363 5514 8374 5399 3634 4131 3050 4587 8197 292 3357 9824 5964 8213 268 2543 8530 9349 5957 6252 4476 9392 1185 8080 4121 6049 8830 8200 4567...
output:
-2301811
result:
ok single line: '-2301811'
Test #42:
score: 0
Accepted
time: 10ms
memory: 7796kb
input:
98473 4 3 -6719 -7078 -7398 -5015 -7801 -5157 -7545 -7138 -8925 -7799 -5790 -9002 -8266 -8910 -8886 -8596 -9386 -8316 -9749 -6022 -9377 -5224 -5896 -5093 -5583 -8813 -6565 -6566 -8566 -9669 -9797 -5545 -6394 -9272 -8662 -5310 -7476 -9208 -7608 -7816 -5213 -6361 -9537 -5138 -6085 -7176 -8669 -5409 -8...
output:
-88721
result:
ok single line: '-88721'
Test #43:
score: 0
Accepted
time: 14ms
memory: 6044kb
input:
99522 3 4 -5545 -6299 -6271 -6711 -6621 -7315 -8092 -5209 -9685 -7075 -5874 -5059 -5233 -6260 -9650 -6267 -7022 -7351 -6960 -7872 -7320 -7577 -8772 -8735 -9558 -5073 -6969 -7098 -7543 -8798 -5128 -7903 -5474 -9796 -8570 -9433 -9267 -6942 -7436 -6657 -9707 -9722 -5243 -5331 -7386 -9384 -8372 -9922 -9...
output:
-138005
result:
ok single line: '-138005'