QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#627682 | #6433. Klee in Solitary Confinement | MahnoKropotkinov# | TL | 924ms | 7856kb | C++20 | 958b | 2024-10-10 16:44:37 | 2024-10-10 16:44:38 |
Judging History
answer
#include <iostream>
#include <map>
using namespace std;
const int maxn = 1e6 + 1;
int a[maxn];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(0);
int n, k;
cin >> n >> k;
auto cnt = map<int, int>(), cur = cnt, Min = cnt, f = cnt;
// cur[x]=count of x-k -count of x
for (int i = 1; i <= n; i++) {
cin >> a[i];
++cnt[a[i]];
// Min[a[i]] = min(Min[a[i]], --cur[a[i]]);
Min[a[i]] = min(Min[a[i]], cur[a[i]] = cnt[a[i] - k] - cnt[a[i]]);
Min[a[i] + k] = min(Min[a[i] + k], cur[a[i] + k] = cnt[a[i]] - cnt[a[i] + k]); // 0 is always valid
f[a[i]] = max(f[a[i]], cur[a[i]] - Min[a[i]]); // changing a[i]-k to a[i], where r=i
f[a[i] + k] = max(f[a[i] + k], cur[a[i] + k] - Min[a[i] + k]);
}
int ans = 0;
for (const auto [k, v] : cnt)
ans = max(ans, v + f[k]);
cout << ans;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3552kb
input:
5 2 2 2 4 4 4
output:
5
result:
ok 1 number(s): "5"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
7 1 3 2 3 2 2 2 3
output:
6
result:
ok 1 number(s): "6"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
7 1 2 3 2 3 2 3 3
output:
5
result:
ok 1 number(s): "5"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
9 -100 -1 -2 1 2 -1 -2 1 -2 1
output:
3
result:
ok 1 number(s): "3"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
200 121649 0 527189 -1000000 -306471 -998939 527189 -1000000 -1000000 0 527189 0 527189 0 527189 -306471 -998939 -306471 -306471 -306471 0 0 527189 527189 1000000 527189 -1000000 1000000 648838 -1000000 -998939 -998939 -998939 0 1000000 -1000000 -998939 527189 1000000 648838 -1000000 1000000 648838 ...
output:
37
result:
ok 1 number(s): "37"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
200 -454379 -385892 454379 -1000000 373644 -665078 -1000000 -1000000 454379 0 1000000 373644 -1000000 1000000 -385892 -1000000 373644 0 -665078 0 -665078 -1000000 -665078 -385892 -665078 -385892 454379 -665078 -385892 -1000000 454379 1000000 -385892 373644 454379 -1000000 -385892 -1000000 -385892 -1...
output:
40
result:
ok 1 number(s): "40"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
200 0 451272 -1000000 677452 677452 0 18908 451272 677452 -233144 677452 451272 18908 -1000000 18908 -1000000 0 451272 0 -233144 677452 1000000 451272 1000000 18908 -1000000 0 -233144 451272 1000000 18908 677452 0 677452 0 677452 1000000 -233144 18908 451272 -1000000 -233144 18908 1000000 0 0 -23314...
output:
35
result:
ok 1 number(s): "35"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3668kb
input:
200 -705945 -586687 198791 0 198791 0 705945 198791 -1000000 705945 705945 1000000 705945 0 -1000000 699023 0 705945 -586687 -1000000 198791 -1000000 1000000 198791 -1000000 198791 705945 -1000000 1000000 1000000 198791 198791 -1000000 699023 0 0 699023 -586687 705945 -586687 705945 699023 0 705945 ...
output:
34
result:
ok 1 number(s): "34"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
200 0 344286 0 -230711 532652 -589794 344286 532652 -1000000 -589794 344286 0 532652 -1000000 344286 344286 1000000 0 -1000000 532652 532652 532652 -230711 -1000000 344286 532652 532652 0 532652 1000000 0 0 1000000 -589794 -1000000 1000000 -1000000 -1000000 344286 0 344286 344286 1000000 -1000000 -1...
output:
34
result:
ok 1 number(s): "34"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
200 -230027 -1000000 -662604 0 1000000 59253 1000000 1000000 -662604 -662604 0 -70266 1000000 -300293 -300293 59253 1000000 -1000000 1000000 0 1000000 -662604 59253 -1000000 -70266 -1000000 -662604 -662604 59253 59253 -1000000 -70266 -70266 1000000 -300293 59253 59253 1000000 -70266 -1000000 -70266 ...
output:
33
result:
ok 1 number(s): "33"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
200 197410 1000000 -665711 0 -271800 -701554 -271800 -1000000 -665711 -665711 -1000000 -271800 1000000 -701554 1000000 -701554 -1000000 1000000 1000000 -1000000 -701554 1000000 -271800 -1000000 -197410 -665711 -701554 1000000 -1000000 -665711 -701554 -701554 -271800 -1000000 -1000000 -271800 -701554...
output:
37
result:
ok 1 number(s): "37"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
200 -96015 791544 -1000000 791544 -1000000 -668818 695529 1000000 -552146 -1000000 -668818 1000000 1000000 1000000 695529 695529 0 791544 -552146 0 1000000 791544 -668818 0 -1000000 0 -1000000 791544 -1000000 791544 1000000 791544 0 -1000000 0 -668818 695529 791544 1000000 695529 695529 -668818 -100...
output:
38
result:
ok 1 number(s): "38"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
200 -1000000 1000000 127969 0 0 0 -970611 0 0 293224 293224 293224 293224 -1000000 -970611 1000000 -1000000 820037 820037 820037 127969 127969 0 0 -970611 1000000 -970611 820037 -1000000 -970611 -1000000 820037 -970611 -1000000 127969 -970611 293224 1000000 293224 1000000 293224 293224 -1000000 8200...
output:
39
result:
ok 1 number(s): "39"
Test #14:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
200 0 0 527518 841746 0 331297 -1000000 595261 841746 527518 1000000 1000000 527518 1000000 527518 0 1000000 0 841746 527518 -1000000 595261 0 595261 -1000000 841746 841746 841746 0 -1000000 595261 331297 841746 0 841746 595261 0 595261 0 0 0 527518 331297 527518 0 841746 331297 0 1000000 -1000000 5...
output:
44
result:
ok 1 number(s): "44"
Test #15:
score: 0
Accepted
time: 0ms
memory: 3620kb
input:
200 -258363 704217 520353 810464 704217 -264059 270856 1000000 838639 810464 -264059 0 704217 945100 945100 813177 328488 1000000 270856 -1000000 1000000 520353 233383 328488 -522422 -187632 -187632 373822 810464 653545 838639 -264059 945100 -187632 -22847 810464 373822 373822 0 -187632 -22847 27085...
output:
17
result:
ok 1 number(s): "17"
Test #16:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
200 181089 -300523 -104331 360450 -108859 1000000 388283 -108859 -118869 -104331 -277725 360450 -104331 727661 1000000 -108859 727661 383704 727661 -628369 727661 -108859 -118869 388283 -83881 -655062 -655062 -199320 1000000 -1000000 -964033 -83881 -964033 -448024 1000000 -104331 569372 800854 38828...
output:
13
result:
ok 1 number(s): "13"
Test #17:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
200 117900 -838409 411806 34821 -766900 67987 34821 46504 46504 -49913 411806 161685 313760 -49913 596234 156661 67987 -646448 161685 -838409 46504 -236598 -766900 -538744 46504 -49913 599791 -1000000 -538744 34821 -646441 -236598 67987 0 -766900 161685 161685 -305084 34821 0 -49913 46504 -49913 156...
output:
14
result:
ok 1 number(s): "14"
Test #18:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
200 88724 -233297 630561 -275237 -275237 505621 416897 0 505621 0 -1000000 416897 -888093 -275237 630561 788662 788662 505621 -1000000 416897 -314063 584906 0 -1000000 -888093 1000000 276966 416897 311201 257302 493457 -852985 -233297 493457 563328 788662 -233297 1000000 584906 -1000000 416897 58490...
output:
14
result:
ok 1 number(s): "14"
Test #19:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
200 739055 -276846 -1000000 -970267 274436 -278344 -276846 690590 -780355 -619119 338671 681144 -970267 537803 338671 -780355 0 885372 -619119 -780355 -711246 235223 274436 445389 460711 460711 -276846 -1000000 690590 400277 681144 351497 -278344 885372 0 -1000000 -711246 -438285 537803 1000000 6905...
output:
15
result:
ok 1 number(s): "15"
Test #20:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
200 -942994 884626 1000000 -491267 884626 -26900 -362264 916094 -705196 -503120 -730425 -705196 -362264 -503120 763328 -26900 12314 -362264 -26900 -281451 1000000 -26900 -503120 916094 -501391 -501391 -705196 -491267 763328 -841371 636579 -730425 636579 -501391 -730425 -26900 -503120 -841371 -705196...
output:
16
result:
ok 1 number(s): "16"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
200 863782 -909322 180110 0 -354261 -98424 -539584 509521 -43919 -654935 -43919 -98424 -909322 -795454 -1000000 -5749 474004 932634 -783914 667659 474004 -43919 289728 -1000000 -795454 -43919 -654935 -354261 -179344 -539584 -886774 -43919 289728 1000000 1000000 509521 -179344 932634 180110 -5749 490...
output:
12
result:
ok 1 number(s): "12"
Test #22:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
200 -86945 4973 274752 -348485 0 -661269 192390 -604418 -604418 0 366658 -618002 366658 200590 113645 1000000 4973 -491231 200590 -933401 -491231 -1000000 0 113645 -357368 192390 -348485 -348485 192390 642587 -462653 -110388 366658 -618002 642587 -491231 -618002 -462653 113645 366658 642587 779540 6...
output:
15
result:
ok 1 number(s): "15"
Test #23:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
200 -96625 67966 96625 -464136 961712 1000000 1000000 -269712 -1000000 79999 784610 604674 -199318 784610 1000000 96625 -199318 961712 -259853 20672 -1000000 -640882 -640882 -259853 -1000000 604674 604674 604674 -479599 -1000000 -259853 79999 784610 961712 -199318 -199318 -977257 -328717 79999 78461...
output:
13
result:
ok 1 number(s): "13"
Test #24:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
200 -672541 875140 -239147 0 875140 -126371 546170 -420922 -239147 -126371 -126371 -530108 -1000000 39354 -534942 -926598 -239147 -999662 542231 542231 -126371 546170 70909 -926598 -983208 -409757 -251037 -267623 -534942 -506813 -126371 875140 -267623 -251037 546170 112393 1000000 503549 590746 -239...
output:
16
result:
ok 1 number(s): "16"
Test #25:
score: 0
Accepted
time: 1ms
memory: 3576kb
input:
200 290556 -562226 -470944 -476890 -855535 896680 625399 -375294 546758 -1000000 86661 -500265 928824 906314 -212125 789141 -384224 150468 -728038 180898 86661 182356 371493 906314 999068 557976 727667 371493 208850 -988123 825950 -103281 -287540 719469 -853452 86661 -342794 -500265 -728038 -721633 ...
output:
5
result:
ok 1 number(s): "5"
Test #26:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
200 179682 929614 -21247 -265968 -21247 -287974 928826 -868203 -563505 514758 877402 173245 -619036 454699 -766433 -592913 948190 629961 68382 948190 636639 -942217 636639 -267329 566108 -623113 -54339 -942217 208640 555793 -804559 795354 -545404 572841 173245 -54339 986929 409171 173245 636639 -685...
output:
7
result:
ok 1 number(s): "7"
Test #27:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
200 -991752 954660 -596546 -525947 1000000 -679108 -542218 365468 -480731 544554 986182 144161 634196 -590564 -506613 986182 -162018 -368859 21502 189307 789950 835550 -299875 176110 -746851 -549131 635606 -565037 -679108 736710 -182064 -395657 9764 185337 -368859 203349 789950 923902 -485907 -48073...
output:
7
result:
ok 1 number(s): "7"
Test #28:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
200 569638 -548355 -691936 -578229 621700 -1000000 -628566 -401673 678066 -255352 968872 -77499 905238 -703331 -104566 -300189 -520809 -722912 -879064 -81938 -284893 609667 678066 -578229 -691936 957065 -643485 755266 155923 -81938 740312 -306969 286750 -77499 968872 -639853 -27086 -892181 -809911 1...
output:
6
result:
ok 1 number(s): "6"
Test #29:
score: 0
Accepted
time: 1ms
memory: 3856kb
input:
200 0 910111 -582315 351686 -304954 -981006 -913772 -531700 -665941 -856809 -82453 -16749 -981006 -176952 431945 974583 -896968 -601100 -631689 629948 -459202 974583 381043 -653184 789031 -152004 494958 269840 -214049 -759445 616294 677636 -531700 -222405 -833624 147927 -92940 -135836 865538 -575424...
output:
9
result:
ok 1 number(s): "9"
Test #30:
score: 0
Accepted
time: 140ms
memory: 7524kb
input:
1000000 890430 -890430 -1000000 -890430 1000000 0 0 148415 148415 0 1000000 1000000 -890430 658440 658440 658440 0 148415 -1000000 0 0 -890430 842292 842292 148415 -501797 148415 -501797 -501797 842292 658440 1000000 -501797 -1000000 -501797 842292 -501797 658440 842292 658440 1000000 148415 -100000...
output:
125227
result:
ok 1 number(s): "125227"
Test #31:
score: 0
Accepted
time: 131ms
memory: 7684kb
input:
1000000 -828531 -278216 -850680 -850680 -195667 -850680 -850680 -850680 -195667 -850680 -850680 -195667 1000000 -195667 -1000000 0 -195667 1000000 -278216 -556570 -850680 -850680 828531 -195667 -850680 828531 -556570 -850680 828531 -556570 828531 -556570 -1000000 1000000 -556570 -1000000 0 -278216 1...
output:
125296
result:
ok 1 number(s): "125296"
Test #32:
score: 0
Accepted
time: 139ms
memory: 7764kb
input:
1000000 -292581 840514 -249723 1000000 -1000000 0 828808 828808 0 -491355 -249723 840514 1000000 -1000000 828808 1000000 -491355 0 0 -198774 840514 828808 -491355 -1000000 -1000000 -198774 0 828808 -1000000 -198774 1000000 828808 -198774 840514 1000000 828808 1000000 -198774 840514 840514 -1000000 -...
output:
125204
result:
ok 1 number(s): "125204"
Test #33:
score: 0
Accepted
time: 134ms
memory: 7748kb
input:
1000000 -554042 1000000 0 479925 -1000000 1000000 1000000 -1000000 209226 1000000 -1000000 763268 763268 -1000000 217131 763268 0 1000000 763268 763268 0 763268 217131 813621 0 0 209226 -1000000 209226 217131 763268 0 -1000000 217131 813621 0 813621 0 1000000 1000000 217131 -1000000 813621 763268 20...
output:
125336
result:
ok 1 number(s): "125336"
Test #34:
score: 0
Accepted
time: 136ms
memory: 7756kb
input:
1000000 633075 586042 586042 -999261 728785 1000000 -1000000 0 95710 -999261 728785 95710 -999261 95710 728785 586042 728785 -1000000 0 95710 -1000000 -999261 911869 586042 -999261 728785 -1000000 -999261 911869 -999261 95710 95710 1000000 911869 1000000 586042 586042 728785 0 95710 95710 -999261 91...
output:
125513
result:
ok 1 number(s): "125513"
Test #35:
score: 0
Accepted
time: 134ms
memory: 7456kb
input:
1000000 470382 -1000000 -1000000 231305 -207871 -1000000 0 92603 -207871 0 1000000 1000000 -1000000 231305 92603 397823 92603 562985 92603 92603 397823 1000000 562985 0 562985 231305 92603 -207871 231305 397823 231305 -207871 -207871 -207871 -207871 562985 1000000 231305 562985 562985 -207871 100000...
output:
125290
result:
ok 1 number(s): "125290"
Test #36:
score: 0
Accepted
time: 130ms
memory: 7556kb
input:
1000000 -1000000 911420 19793 0 -179379 -1000000 911420 911420 1000000 214102 19793 214102 0 -233466 214102 214102 -1000000 214102 911420 19793 0 -179379 -1000000 -1000000 1000000 19793 -179379 -179379 1000000 -233466 -179379 1000000 911420 911420 19793 1000000 -179379 0 911420 0 0 -233466 19793 -23...
output:
125338
result:
ok 1 number(s): "125338"
Test #37:
score: 0
Accepted
time: 140ms
memory: 7524kb
input:
1000000 -820743 -1000000 -836383 -1000000 -179257 -179257 -408465 -836383 -179257 -179257 -408465 -179257 -408465 1000000 -179257 -179257 -836383 16686 -1000000 16686 -1000000 -179257 16686 1000000 1000000 -179257 -179257 -836383 -1000000 -408465 1000000 16686 -1000000 -408465 16686 1000000 -1000000...
output:
125243
result:
ok 1 number(s): "125243"
Test #38:
score: 0
Accepted
time: 123ms
memory: 7400kb
input:
1000000 0 300021 0 814385 -502522 -455294 1000000 -455294 -455294 0 -1000000 300021 814385 -455294 1000000 0 978728 -502522 814385 300021 -502522 -1000000 1000000 -502522 -502522 -455294 300021 -455294 0 814385 0 -455294 -455294 0 -502522 814385 -1000000 -455294 -502522 0 1000000 -502522 -455294 978...
output:
125088
result:
ok 1 number(s): "125088"
Test #39:
score: 0
Accepted
time: 127ms
memory: 7460kb
input:
1000000 1000000 -1000000 894561 894561 14988 -804178 -59231 -1000000 0 -804178 -59231 0 -1000000 -804178 894561 14988 -1000000 14988 -804178 14988 0 894561 1000000 -59231 -804178 -122272 -1000000 -804178 -804178 -122272 -59231 0 14988 -1000000 1000000 1000000 894561 -122272 0 894561 14988 1000000 10...
output:
125290
result:
ok 1 number(s): "125290"
Test #40:
score: 0
Accepted
time: 140ms
memory: 7464kb
input:
1000000 992649 -339749 1000000 902811 -339749 -89838 263273 1000000 263273 -339749 263273 -1000000 0 -1000000 0 -93779 -93779 902811 -1000000 -339749 -89838 0 1000000 1000000 1000000 -339749 902811 -89838 -339749 -93779 263273 263273 0 -89838 -93779 902811 0 -339749 -93779 1000000 -1000000 263273 90...
output:
125327
result:
ok 1 number(s): "125327"
Test #41:
score: 0
Accepted
time: 140ms
memory: 7720kb
input:
1000000 779087 -1000000 340366 1000000 340366 969565 -438721 899705 -1000000 1000000 -438721 -438721 340366 1000000 969565 -1000000 899705 899705 1000000 340366 340366 -438721 0 -1000000 340366 899705 969565 -1000000 1000000 969565 -438721 -1000000 -438721 969565 899705 969565 -438721 899705 899705 ...
output:
125291
result:
ok 1 number(s): "125291"
Test #42:
score: 0
Accepted
time: 128ms
memory: 7520kb
input:
1000000 -914354 -979519 -1000000 275618 896598 -65165 0 -979519 896598 -65165 0 92290 -65165 0 896598 1000000 -1000000 0 0 92290 1000000 -979519 0 -65165 -65165 1000000 1000000 -1000000 -65165 -65165 1000000 0 92290 -979519 -1000000 -1000000 -979519 1000000 -1000000 -1000000 275618 92290 275618 9229...
output:
125281
result:
ok 1 number(s): "125281"
Test #43:
score: 0
Accepted
time: 122ms
memory: 7516kb
input:
1000000 0 -1000000 823788 -36672 823788 -36672 665745 -538998 -36672 823788 665745 823788 -1000000 0 891884 823788 -538998 1000000 823788 -538998 -36672 1000000 0 665745 -1000000 891884 665745 -1000000 0 -36672 0 -538998 823788 823788 665745 823788 1000000 -1000000 -538998 665745 0 1000000 1000000 -...
output:
125093
result:
ok 1 number(s): "125093"
Test #44:
score: 0
Accepted
time: 137ms
memory: 7528kb
input:
1000000 382113 97877 -782336 97877 1000000 -782336 -808919 358678 -782336 358678 -808919 -808919 -808919 -782336 0 97877 0 -1000000 1000000 97877 -782336 0 -23435 0 0 -808919 358678 -23435 -782336 -1000000 0 -23435 -808919 -23435 -1000000 -782336 -1000000 -808919 -782336 -23435 1000000 -23435 0 -782...
output:
125354
result:
ok 1 number(s): "125354"
Test #45:
score: 0
Accepted
time: 136ms
memory: 7460kb
input:
1000000 33108 -1000000 1000000 0 1000000 586377 586377 -1000000 -1000000 -256859 586377 1000000 586377 941836 974944 941836 974944 974944 0 586377 0 974944 941836 -1000000 -256859 0 0 941836 1000000 -1000000 -256859 1000000 -1000000 586377 586377 974944 586377 0 0 0 586377 0 -256859 -1000000 -256859...
output:
125274
result:
ok 1 number(s): "125274"
Test #46:
score: 0
Accepted
time: 133ms
memory: 7520kb
input:
1000000 -983460 423256 423256 -1000000 1000000 423256 626061 0 -884836 1000000 626061 626061 626061 626061 -884836 626061 423256 5180 -884836 -16540 626061 423256 5180 626061 5180 -1000000 -16540 626061 5180 -1000000 5180 423256 5180 423256 0 0 0 -1000000 626061 -16540 -1000000 5180 5180 0 5180 0 51...
output:
125340
result:
ok 1 number(s): "125340"
Test #47:
score: 0
Accepted
time: 121ms
memory: 7452kb
input:
1000000 0 33672 -1000000 -896629 1000000 -887943 33672 33672 0 317320 1000000 -1000000 -1000000 1000000 0 33672 -896629 317320 -896629 1000000 -659601 317320 1000000 -659601 -1000000 -659601 -887943 -1000000 -1000000 -659601 -896629 0 -659601 -896629 33672 -659601 -887943 1000000 -896629 0 -1000000 ...
output:
125100
result:
ok 1 number(s): "125100"
Test #48:
score: 0
Accepted
time: 140ms
memory: 7404kb
input:
1000000 -74099 -216514 74099 -285597 -1000000 -216514 -216514 -216514 1000000 74099 -216514 -216514 74099 -1000000 -216514 74099 991517 -285597 -285597 -902984 1000000 -902984 991517 74099 74099 -285597 74099 -1000000 -1000000 -1000000 1000000 0 1000000 1000000 74099 991517 74099 -285597 -1000000 -2...
output:
125356
result:
ok 1 number(s): "125356"
Test #49:
score: 0
Accepted
time: 124ms
memory: 7716kb
input:
1000000 0 -1000000 642633 -963860 642633 -963860 -874491 146338 -473177 -1000000 642633 0 146338 1000000 1000000 146338 -473177 -473177 -874491 -874491 -874491 -963860 642633 1000000 146338 -963860 642633 -1000000 146338 -1000000 -963860 146338 642633 -1000000 -1000000 1000000 -1000000 -473177 14633...
output:
125089
result:
ok 1 number(s): "125089"
Test #50:
score: 0
Accepted
time: 139ms
memory: 7408kb
input:
1000000 -1818 -827913 0 1000000 322121 -1818 -1000000 322121 322121 -484951 1000000 -1000000 322121 0 -484951 90779 1000000 -1818 322121 90779 -827913 -1000000 -1000000 -1000000 322121 0 0 -1000000 1000000 1000000 -484951 -1000000 -827913 90779 -484951 -827913 -484951 0 0 -827913 90779 90779 90779 -...
output:
125252
result:
ok 1 number(s): "125252"
Test #51:
score: 0
Accepted
time: 127ms
memory: 7516kb
input:
1000000 -973237 -4925 0 -1000000 0 -4925 -147798 119272 1000000 -4925 0 -1000000 -26763 0 -1000000 119272 1000000 912133 -1000000 119272 1000000 -1000000 912133 1000000 119272 1000000 -26763 -4925 0 912133 0 119272 0 1000000 119272 -26763 0 0 -1000000 -1000000 -26763 912133 -1000000 912133 0 -100000...
output:
125166
result:
ok 1 number(s): "125166"
Test #52:
score: 0
Accepted
time: 139ms
memory: 7720kb
input:
1000000 -467683 -817385 -817385 0 -754007 1000000 -754007 -1000000 -817385 532317 -8032 532317 -817385 0 532317 0 1000000 687577 -817385 1000000 -1000000 532317 -8032 687577 -1000000 1000000 -8032 1000000 -1000000 -817385 687577 532317 -817385 1000000 687577 687577 -8032 -8032 -754007 -817385 0 -803...
output:
125295
result:
ok 1 number(s): "125295"
Test #53:
score: 0
Accepted
time: 136ms
memory: 7460kb
input:
1000000 211108 -1000000 -322073 -787568 -788892 0 338693 0 -1000000 -322073 1000000 -80842 -322073 -787568 -80842 -787568 1000000 1000000 0 338693 -80842 -788892 1000000 -80842 -322073 -322073 -80842 1000000 -1000000 1000000 0 1000000 -322073 0 -80842 -80842 -787568 -322073 -1000000 338693 1000000 0...
output:
125305
result:
ok 1 number(s): "125305"
Test #54:
score: 0
Accepted
time: 135ms
memory: 7456kb
input:
1000000 -455813 0 -390287 1000000 161124 -390287 161124 1000000 -292586 0 -1000000 -292586 161124 -390287 161124 -1000000 1000000 161124 1000000 -292586 -390287 -1000000 -1000000 1000000 161124 -292586 0 0 0 0 -593781 161124 -292586 -593781 -748399 1000000 -1000000 1000000 -1000000 -292586 -593781 0...
output:
125431
result:
ok 1 number(s): "125431"
Test #55:
score: 0
Accepted
time: 180ms
memory: 7504kb
input:
1000000 -185077 822848 421754 421754 464598 689264 689264 890032 464598 383108 -1000000 -380590 -286366 289829 0 289829 1000000 689264 -927460 595028 -61837 -286366 -628684 0 189617 -628684 724949 595028 -799487 890032 -642234 -927460 4540 -380590 -927460 890032 -628684 890032 -61837 822848 4540 764...
output:
30564
result:
ok 1 number(s): "30564"
Test #56:
score: 0
Accepted
time: 178ms
memory: 7468kb
input:
1000000 289211 653466 0 640671 890971 198740 -652602 -747040 -747040 -961982 -747040 -206663 912779 912779 -617702 969944 -717020 -757022 200385 1000000 -617702 -100665 912779 -289258 -663134 234619 401688 -980019 234619 890971 -961982 -893881 653466 -663134 1000000 -980019 0 210536 -747040 0 -98001...
output:
30788
result:
ok 1 number(s): "30788"
Test #57:
score: 0
Accepted
time: 173ms
memory: 7528kb
input:
1000000 94907 290267 207429 -829351 -1000000 413225 -754515 -152897 -849422 -165598 -849422 -113883 569542 0 207429 421229 0 -829351 -718547 413225 983938 -113883 -855015 -1000000 -855015 -849422 -244670 -244670 207429 1000000 999053 -244670 -173126 -510908 -247642 413225 -755309 620983 534246 -7543...
output:
30642
result:
ok 1 number(s): "30642"
Test #58:
score: 0
Accepted
time: 167ms
memory: 7504kb
input:
1000000 -865381 1000000 622336 -644425 935472 825561 -1000000 149242 204755 -961583 -596526 -279472 622336 149242 524626 -1000000 -861057 884505 -861057 524626 884505 246723 -441151 134619 -704678 -231615 390635 -557382 884505 524626 622336 622336 894520 0 -596526 -596526 401520 894520 -231615 20475...
output:
30798
result:
ok 1 number(s): "30798"
Test #59:
score: 0
Accepted
time: 165ms
memory: 7524kb
input:
1000000 0 -24563 -947286 -215182 334892 -189399 -562410 -535026 -24563 -364049 -77680 -859215 -685932 -189399 -363716 -331878 131512 -691159 -189399 133204 -689933 334892 -562410 -689933 -77680 0 -200700 -364049 -691159 133204 -364049 -512296 -77680 -859215 599651 -691159 -562410 951293 -145538 -512...
output:
30819
result:
ok 1 number(s): "30819"
Test #60:
score: 0
Accepted
time: 179ms
memory: 7528kb
input:
1000000 692596 871615 941296 -661440 979735 1000000 -477710 0 -753597 57194 -268026 -1000000 -477710 -459891 -290978 -1000000 -134744 77298 803783 -4652 -692596 979735 157512 941296 892200 -692596 -661440 -268026 -268026 308667 1000000 -4652 645428 -281226 -281226 -661440 -661440 -661440 -692596 -93...
output:
30651
result:
ok 1 number(s): "30651"
Test #61:
score: 0
Accepted
time: 175ms
memory: 7568kb
input:
1000000 234556 -288109 76070 -874389 -184394 127584 54919 -369696 -659510 1000000 -452649 -184394 799401 -10605 -381369 -381369 650702 -452649 -171415 -632948 -315736 -49757 -579953 -369696 799401 -579953 376511 21248 885940 65835 65835 76070 -171415 54919 398890 -156468 -156468 -632948 -10605 76070...
output:
30808
result:
ok 1 number(s): "30808"
Test #62:
score: 0
Accepted
time: 181ms
memory: 7528kb
input:
1000000 170261 427401 1000000 -260337 1000000 673394 -179112 -1000000 707330 276484 52488 -410238 220214 -352944 -260337 -1000000 586437 -998045 44153 -821563 137411 -626767 -890105 -626767 -352944 -221096 137411 220214 930347 -626767 305137 305137 -221096 -716571 951174 586437 -821563 586437 -10000...
output:
30583
result:
ok 1 number(s): "30583"
Test #63:
score: 0
Accepted
time: 180ms
memory: 7480kb
input:
1000000 358271 -330798 868703 658973 -389408 -160555 -1000000 155080 -724314 -105148 -527133 -527133 1000000 155080 155080 -71580 -912681 -403471 -451752 -214497 155080 -604334 -105148 155080 724269 -945430 -348532 -64061 -214497 -389408 -527133 -389408 -985471 697270 1000000 -387344 -105148 -527133...
output:
30713
result:
ok 1 number(s): "30713"
Test #64:
score: 0
Accepted
time: 175ms
memory: 7528kb
input:
1000000 -645608 -1000000 1000000 848201 -667657 -667657 -511178 -98956 -50670 -65566 374053 -247219 -376856 651159 -511178 917768 -50670 374053 -213223 208720 917768 -376856 374053 -845776 1000000 208720 703935 -98956 917768 -494155 -845776 1000000 -109896 830694 -273415 208720 835045 -98956 651159 ...
output:
30780
result:
ok 1 number(s): "30780"
Test #65:
score: 0
Accepted
time: 906ms
memory: 7856kb
input:
1000000 -205285 -67229 -78870 -304921 -126100 -291564 83367 169305 -593837 402329 -481219 28675 910676 -679524 878163 402728 842144 169731 -469228 -170268 -565627 639902 -359096 951598 0 -386554 837154 -342834 -404731 -704418 67606 -324098 -45061 -596038 399338 577151 800389 -704418 -291564 -350439 ...
output:
3440
result:
ok 1 number(s): "3440"
Test #66:
score: 0
Accepted
time: 924ms
memory: 7600kb
input:
1000000 -240764 330248 -15518 188495 22565 971056 -445418 -382564 22565 -176064 95053 740607 -505197 402668 -232040 69798 -1000000 -171522 969380 179107 -145891 -204953 -645913 304916 -477118 261678 -736704 721290 -204953 47720 489137 -771110 769093 489137 -755096 764298 -627272 -149660 -471415 1245...
output:
3438
result:
ok 1 number(s): "3438"
Test #67:
score: 0
Accepted
time: 887ms
memory: 7604kb
input:
1000000 -761186 883155 714302 833256 -847661 -270297 553291 -849786 -989261 581538 258095 203117 563584 979872 910883 396291 508731 -837229 -585119 994376 435362 -299333 -539973 -538905 579999 -312366 961355 237294 579999 -306881 228584 671761 676033 -579775 -837229 -842854 435362 77028 -213182 7619...
output:
3461
result:
ok 1 number(s): "3461"
Test #68:
score: 0
Accepted
time: 886ms
memory: 7656kb
input:
1000000 714790 -423644 -718238 -246419 -761563 828298 -246419 707042 39762 -423644 -845267 -779643 808980 -794233 -830437 -512731 -842178 55980 -867434 -341319 -659422 -61540 -794233 456999 679668 894606 -696881 24372 -635396 -434557 -431979 -883246 335397 871571 -1828 -224524 -842178 954892 159534 ...
output:
3461
result:
ok 1 number(s): "3461"
Test #69:
score: 0
Accepted
time: 879ms
memory: 7664kb
input:
1000000 841908 -35399 -245483 799308 -742674 -630465 605052 -105676 -421349 595217 69906 781750 151082 -492527 -118346 -804640 -231923 377556 36704 903574 -136732 269501 204891 632397 -376038 -410648 265254 -537904 -587018 -442931 407227 464270 1000000 -930380 -131702 -492527 734700 102402 506825 30...
output:
3477
result:
ok 1 number(s): "3477"
Test #70:
score: 0
Accepted
time: 915ms
memory: 7600kb
input:
1000000 -180047 -937710 -68641 -649854 -876502 627055 -874960 648828 752094 -681156 854356 573813 -784126 -158277 -418220 -561185 471856 -221861 378042 636133 -1000000 -431922 202506 -185993 39488 -747853 454046 658255 -571243 -861914 658255 915403 -886887 -435889 -833847 -689444 -861914 -491163 -84...
output:
3484
result:
ok 1 number(s): "3484"
Test #71:
score: 0
Accepted
time: 885ms
memory: 7652kb
input:
1000000 -751719 748023 -917917 75652 974066 219786 898050 -67793 866858 -317637 991177 594707 -831910 -958007 -371332 737275 -1000000 -660759 558638 -316446 -599052 656446 219786 -910026 164044 -393867 -599052 187120 -948795 529898 -248458 937774 -476232 -756466 -525172 -522783 -566764 915507 296509...
output:
3463
result:
ok 1 number(s): "3463"
Test #72:
score: 0
Accepted
time: 889ms
memory: 7668kb
input:
1000000 -744416 -986673 -959316 587461 -56500 554263 0 700422 25247 235387 -736188 -589883 -612287 547683 -962956 760009 -329990 806588 81020 588808 156739 327124 885302 899098 -337621 281598 1000000 614955 -397586 -511127 626059 597827 -369186 -391744 410487 806588 211082 851388 1000000 -680729 961...
output:
3422
result:
ok 1 number(s): "3422"
Test #73:
score: 0
Accepted
time: 875ms
memory: 7596kb
input:
1000000 -825206 -605336 -816591 146497 -70052 -596991 -285443 48101 210935 -215062 -607187 -623730 83790 673691 389025 827925 -968065 592100 -923498 -395642 -288928 626574 -687136 -669220 794071 -576237 -992181 -592478 637341 1000000 -411815 -28382 827925 -31551 972772 254113 -404582 -834513 127494 ...
output:
3468
result:
ok 1 number(s): "3468"
Test #74:
score: 0
Accepted
time: 907ms
memory: 7856kb
input:
1000000 -123605 -288960 -945694 -547917 -966137 993486 -138624 -847259 118061 -341545 847320 -465380 97457 447769 918183 -639580 466230 -240924 115100 475877 918183 -40381 -516411 -601440 -743262 -515623 135622 -298546 153085 382247 -311691 -771469 -368412 392287 -309109 128336 856170 25151 868670 3...
output:
3482
result:
ok 1 number(s): "3482"
Test #75:
score: -100
Time Limit Exceeded
input:
1000000 -648055 620078 -105299 -814944 769333 -850734 773229 584794 -47452 668416 -578686 -519359 968114 -425815 978051 715231 775906 -65918 975864 -849963 735277 659009 -479161 223941 528044 -893002 45103 -46783 -620609 510745 -464565 508150 665057 -979864 -937800 909934 -165392 79178 312849 786365...