QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#130955#2554. AND PLUS ORwaifuSenpai#AC ✓460ms9728kbC++17628b2023-07-25 20:08:512023-07-25 20:08:52

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3484kb

input:

2
0 1 1 2

output:

-1

result:

ok Correct

Test #2:

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

input:

2
0 1 1 3

output:

1 2

result:

ok Correct

Test #3:

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

input:

0
100

output:

-1

result:

ok Correct

Test #4:

score: 0
Accepted
time: 2ms
memory: 3448kb

input:

12
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

-1

result:

ok Correct

Test #5:

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

input:

12
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #6:

score: 0
Accepted
time: 5ms
memory: 3540kb

input:

14
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

-1

result:

ok Correct

Test #7:

score: 0
Accepted
time: 5ms
memory: 5744kb

input:

14
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #8:

score: 0
Accepted
time: 43ms
memory: 5772kb

input:

17
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

-1

result:

ok Correct

Test #9:

score: 0
Accepted
time: 34ms
memory: 3988kb

input:

17
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #10:

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

input:

18
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

-1

result:

ok Correct

Test #11:

score: 0
Accepted
time: 91ms
memory: 6368kb

input:

18
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #12:

score: 0
Accepted
time: 460ms
memory: 9296kb

input:

20
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

-1

result:

ok Correct

Test #13:

score: 0
Accepted
time: 433ms
memory: 9728kb

input:

20
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #14:

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

input:

12
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

1024 2048

result:

ok Correct

Test #15:

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

input:

14
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

4096 8192

result:

ok Correct

Test #16:

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

input:

17
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

32768 65536

result:

ok Correct

Test #17:

score: 0
Accepted
time: 43ms
memory: 9576kb

input:

20
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

262144 524288

result:

ok Correct

Test #18:

score: 0
Accepted
time: 453ms
memory: 9568kb

input:

20
10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 10000000 ...

output:

-1

result:

ok Correct

Test #19:

score: 0
Accepted
time: 5ms
memory: 3560kb

input:

14
0 287591 280332 513369 288652 477661 551010 685465 208821 396938 464307 597870 467487 557022 704999 739980 383454 590303 579332 731627 653998 762265 831902 885615 579099 686474 750131 802952 819657 828450 972715 926954 267900 553415 491856 722817 531352 718285 737334 869713 474407 660448 673517 8...

output:

-1

result:

ok Correct

Test #20:

score: 0
Accepted
time: 37ms
memory: 4156kb

input:

17
0 340669 312301 598416 390680 632767 685007 872540 238892 480087 526347 712988 599586 742199 869067 957126 467164 727091 695011 900384 839736 1001081 1049609 1156400 692880 853333 895881 1001780 1035466 1097337 1220493 1227810 345073 683666 600998 885037 710553 950564 948504 1133961 581651 820770...

output:

-1

result:

ok Correct

Test #21:

score: 0
Accepted
time: 429ms
memory: 8384kb

input:

20
0 434418 373306 753170 489819 825655 845151 1126433 260418 595362 608878 889268 720251 956613 1050737 1232545 555130 908806 843982 1143104 1026841 1281935 1297719 1498259 802372 1056574 1066378 1266026 1244097 1399717 1490129 1591195 459532 891874 776462 1154250 924151 1257911 1223107 1502313 717...

output:

-1

result:

ok Correct

Test #22:

score: 0
Accepted
time: 2ms
memory: 3528kb

input:

14
0 287591 280332 513369 288652 477661 551010 685465 208821 396938 464307 597870 467487 557022 704999 739980 383454 590303 579332 731627 653998 762265 831902 885615 579099 686474 750131 802952 819657 828450 972715 926954 267900 553415 491856 722817 531352 718285 737334 869713 474407 660448 673517 8...

output:

197 4292

result:

ok Correct

Test #23:

score: 0
Accepted
time: 3ms
memory: 3988kb

input:

17
0 340669 312301 598416 390680 632767 685007 872540 238892 480087 526347 712988 599586 742199 869067 957126 467164 727091 695011 900384 839736 1001081 1049609 1156400 692880 853333 895881 1001780 1035466 1097337 1220493 1227810 345073 683666 600998 885037 710553 950564 948504 1133961 581651 820770...

output:

1547 3593

result:

ok Correct

Test #24:

score: 0
Accepted
time: 50ms
memory: 9512kb

input:

20
0 434418 373306 753170 489819 825655 845151 1126433 260418 595362 608878 889268 720251 956613 1050737 1232545 555130 908806 843982 1143104 1026841 1281935 1297719 1498259 802372 1056574 1066378 1266026 1244097 1399717 1490129 1591195 459532 891874 776462 1154250 924151 1257911 1223107 1502313 717...

output:

3899 7994

result:

ok Correct

Test #25:

score: 0
Accepted
time: 5ms
memory: 3536kb

input:

14
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #26:

score: 0
Accepted
time: 42ms
memory: 5960kb

input:

17
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #27:

score: 0
Accepted
time: 426ms
memory: 8148kb

input:

20
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 2 3 2 3 3 4 3 4 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 3 4 3 4 4 5 4 5 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 3 4 3 4 4 5 4 5 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 4 5 4 5 5 6 5 6 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

-1

result:

ok Correct

Test #28:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

14
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

591 2631

result:

ok Correct

Test #29:

score: 0
Accepted
time: 6ms
memory: 3976kb

input:

17
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 5 6 4 5 5 6 5 6 6 7 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

4399 20779

result:

ok Correct

Test #30:

score: 0
Accepted
time: 71ms
memory: 9616kb

input:

20
0 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 1 2 2 3 2 3 2 3 2 3 3 4 3 4 3 4 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 3 4 3 4 4 5 4 5 4 5 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3 4 3 4 3 4 4 5 4 5 4 5 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 3 4 4 5 4 5 4 5 4 5 5 6 5 6 5 6 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 2 3 3 4 3...

output:

91469 222540

result:

ok Correct

Test #31:

score: 0
Accepted
time: 2ms
memory: 3488kb

input:

14
0 500001 500002 1000003 500004 1000005 1000006 1500007 500008 1000009 1000010 1500011 1000012 1500013 1500014 2000015 500016 1000017 1000018 1500019 1000020 1500021 1500022 2000023 1000024 1500025 1500026 2000027 1500028 2000029 2000030 2500031 500032 1000033 1000034 1500035 1000036 1500037 15000...

output:

229 357

result:

ok Correct

Test #32:

score: 0
Accepted
time: 5ms
memory: 4108kb

input:

17
0 500001 500002 1000003 500004 1000005 1000006 1500007 500008 1000009 1000010 1500011 1000012 1500013 1500014 2000015 500016 1000017 1000018 1500019 1000020 1500021 1500022 2000023 1000024 1500025 1500026 2000027 1500028 2000029 2000030 2500031 500032 1000033 1000034 1500035 1000036 1500037 15000...

output:

229 357

result:

ok Correct

Test #33:

score: 0
Accepted
time: 13ms
memory: 4656kb

input:

18
0 500001 500002 1000003 500004 1000005 1000006 1500007 500008 1000009 1000010 1500011 1000012 1500013 1500014 2000015 500016 1000017 1000018 1500019 1000020 1500021 1500022 2000023 1000024 1500025 1500026 2000027 1500028 2000029 2000030 2500031 500032 1000033 1000034 1500035 1000036 1500037 15000...

output:

229 357

result:

ok Correct

Test #34:

score: 0
Accepted
time: 3ms
memory: 3524kb

input:

14
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

8191 12287

result:

ok Correct

Test #35:

score: 0
Accepted
time: 13ms
memory: 3984kb

input:

17
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

65535 98303

result:

ok Correct

Test #36:

score: 0
Accepted
time: 152ms
memory: 8584kb

input:

20
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

output:

524287 786431

result:

ok Correct

Test #37:

score: 0
Accepted
time: 140ms
memory: 8508kb

input:

20
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

491520 753664

result:

ok Correct

Test #38:

score: 0
Accepted
time: 127ms
memory: 9184kb

input:

20
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

507904 770048

result:

ok Correct

Test #39:

score: 0
Accepted
time: 147ms
memory: 8264kb

input:

20
9999998 9999996 9999996 9999992 9999996 9999992 9999992 9999984 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999996 9999992 9999992 9999984 9999992 9999984 9999984 9999968 9999992 9999984 9999984 9999968 9999984 9999968 9999968 9999936 9999996 9999992 9999992 9999984 9999992 9...

output:

516096 778240

result:

ok Correct

Test #40:

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

input:

3
2040 17078 28734 21453 5210 16891 6250 12181

output:

3 6

result:

ok Correct