QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#841372#4255. Sone2Huluobo100 ✓676ms28256kbC++149.1kb2025-01-03 17:39:432025-01-03 17:39:43

Details

Tip: Click on the bar to expand more detailed information

Pretests


Final Tests

Test #1:

score: 5
Accepted
time: 3ms
memory: 22756kb

input:

1
1000
2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 2 3 1 299 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 3 2 3 1 2 3 2 3 1 2 3 2 3 1 2 3 2 824 1...

output:

46 1
12 2
46 1
46 1
73 1
100 1
51 1
100 1
100 1
73 1
0
73 1
73 1
73 1
73 1
73 1
19 1
51 1
73 1
73 1
73 1
44 1
51 1
51 1
73 1
22 2
73 1
46 1
0
73 1
yes
57 1
73 1
73 1
73 1
73 1
73 1
73 1
73 1
73 1
51 1
yes
73 1
51 1
73 1
30 1
73 1
73 1
15 1
73 1
73 1
73 1
73 1
46 1
73 1
65 1
0
73 1
12 1
3 1
73 1
73 1...

result:

ok 1911 tokens

Test #2:

score: 5
Accepted
time: 4ms
memory: 24680kb

input:

2
1000
3 2 4 3 2 4 3 2 4 3 2 3 2 4 3 2 4 3 2 4 3 2 3 2 4 3 2 4 3 2 4 406 2 3 2 4 3 2 4 3 3 2 4 3 2 4 3 2 4 3 2 3 2 4 3 2 4 3 2 4 3 2 3 2 98 3 2 4 3 2 4 3 2 3 2 4 3 2 4 3 3 2 4 3 2 4 3 2 4 3 2 3 2 4 3 2 4 3 2 4 3 2 4 3 2 4 3 2 4 3 2 3 2 4 3 2 4 3 2 4 3 2 3 2 4 3 2 970 3 2 4 3 2 3 2 4 3 2 4 3 3 2 4 3 ...

output:

62 1
93 1
62 3
93 1
62 2
65 1
93 1
93 1
93 1
93 1
93 1
62 2
1
93 1
93 1
62 2
62 2
62 3
42 1
93 1
93 1
62 2
44 1
93 1
62 2
93 1
62 1
93 1
72 1
72 1
62 1
72 1
23 1
72 1
no
62 2
72 1
72 1
72 1
62 3
72 1
72 1
72 1
no
43 1
72 1
62 2
40 1
62 2
8 1
62 2
62 2
0
62 2
62 1
62 1
62 1
62 2
62 2
62 1
62 2
5
62 1...

result:

ok 1915 tokens

Test #3:

score: 5
Accepted
time: 193ms
memory: 24108kb

input:

3
100000
1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1 3 1 1 3 1 1 3 1 1 3 1 3 1 1...

output:

100 979
100 978
4
100 978
100 977
100 976
100 975
100 974
100 973
100 972
100 971
100 971
100 970
100 969
100 968
100 967
100 966
100 966
100 965
100 965
9
100 964
no
100 964
100 963
100 962
100 961
100 960
100 959
100 958
100 957
100 956
100 955
yes
100 954
100 954
100 953
100 952
100 951
100 950
1...

result:

ok 191356 tokens

Test #4:

score: 5
Accepted
time: 205ms
memory: 26100kb

input:

4
100000
1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 1...

output:

100 979
100 978
100 977
100 976
100 975
100 974
100 974
100 973
no
100 972
100 971
100 970
100 970
100 969
100 968
100 967
100 966
no
100 965
100 964
100 963
100 962
100 961
100 960
100 959
100 959
0
100 958
100 957
100 957
100 957
100 956
100 955
100 954
100 953
0
100 952
2
100 951
100 950
100 950
...

result:

ok 191356 tokens

Test #5:

score: 5
Accepted
time: 638ms
memory: 25996kb

input:

5
100000
5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 5 3 3 5 3 3 5 3 3 5 3 3...

output:

30 3312
30 1774
30 3311
30 2286
0
30 365
30 3310
30 3309
30 3308
30 3307
30 3306
30 3305
30 1856
30 387
30 1033
30 3304
30 1681
30 3303
30 3302
30 3302
30 3301
30 3300
30 845
30 544
30 2719
30 3299
30 1344
30 3298
30 3298
yes
30 3297
30 3296
30 3295
30 473
30 3294
30 3293
30 3292
yes
30 859
30 3291
...

result:

ok 191359 tokens

Test #6:

score: 5
Accepted
time: 641ms
memory: 24220kb

input:

6
100000
2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2 3 2 2...

output:

30 33114
30 12379
30 33114
30 33104
30 23307
30 33094
30 33084
30 1497
no
30 33074
30 13431
30 33064
30 19
30 33054
30 33044
30 4288
30 10728
30 33034
30 6847
30 33024
30 10621
30 33014
30 10308
1
30 11959
30 3935
30 19153
30 33004
30 32994
30 2789
30 32984
30 32984
0
30 21909
30 32984
30 10889
30 3...

result:

ok 191357 tokens

Test #7:

score: 5
Accepted
time: 20ms
memory: 27552kb

input:

7
100000
1 2 1 1 1 1 1 2 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 1 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 2 1 1 3 4 2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 4 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

1
0
1
4
1
5
1
12
2
7
3
4
4
0
0
1
0
1
3
2
2
2
1
3
0
3
2
3
2
7
0
2
1
1
3
78193
0
5
2
8
7
10
4
4
2
1
0
0
1
1
9
0
1
2
1
7
10
0
0
0
6
0
0
4
7
4
3
1
2
0
0
1
12
2
0
2
5
3
1
0
3
4
7
1
0
9
4
1
5
2
6
23
0
12
6
6
0
2
8
4
2
5
2
1
0
3
10
8
0
2
5
1
2
6
5
9
1
0
0
9
4
3
0
5
0
0
6
4
4
0
1
3
13
0
2
4
1
5
2
0
5
4
2
1
...

result:

ok 100000 tokens

Test #8:

score: 5
Accepted
time: 19ms
memory: 27832kb

input:

8
100000
1 2 1 1 1 1 1 2 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 1 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 2 1 1 3 4 2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 4 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...

output:

0
8
5
2
0
8
4
8
1
2
0
2
0
1
9
1
0
0
0
2
2
0
0
3
0
4
3
1
5
1
5
2
3
11
8
2
3
3
6
2
0
3
0
1
1
1
3
1
0
16
8
0
0
8
13
4
0
3
0
3
0
0
0
0
0
4
7
2
0
2
8
10
0
0
0
4
0
8
2
0
0
7
1
3
5
9
1
0
2
4
0
8
0
3
2
4
1
3
0
0
1
1
5
8
1
0
0
2
4
2
0
3
0
1
3
0
2
0
1
2
15
0
5
2
13
0
3
0
0
0
1
1
3
4
1
1
2
0
4
2
2
14
1
4
5
9
0...

result:

ok 100000 tokens

Test #9:

score: 5
Accepted
time: 28ms
memory: 27660kb

input:

9
100000
1 1 1 1 1 1 1 3 1 1 1 1 2 3 1 2 1 1 1 1 1 1 1 1 2 1 2 1 1 1 3 1 1 1 1 1 2 2 1 1 1 1 1 1 2 2 1 1 1 3 1 1 1 1 2 1 1 1 3 1 1 1 1 2 1 1 1 2 1 1 3 3 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 3 1 1 2 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 2 1 2 3 2 2 1 3 1 1 1 3 3 1 2 1 1 1 1 1 1 3 1 3 2 1 1 1 1 1 1 1 1 1 2 3 1 1 1...

output:

no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
yes
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
yes
yes
no
no
no
no
no
no
...

result:

ok 100000 tokens

Test #10:

score: 5
Accepted
time: 22ms
memory: 27580kb

input:

10
100000
1 1 3 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 3 1 1 1 1 2 3 1 2 1 1 1 1 1 1 1 1 2 1 2 1 1 1 3 1 1 1 1 1 2 2 1 1 1 1 1 1 2 2 1 1 1 3 1 1 1 1 2 1 1 1 3 1 1 1 1 2 1 1 1 2 1 1 3 3 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 3 1 1 2 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 2 1 2 3 2 2 1 3 1 1 1 3 3 1 2 1 ...

output:

no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
yes
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
no
no
no
no
no
no
no
no
...

result:

ok 100000 tokens

Test #11:

score: 5
Accepted
time: 663ms
memory: 28164kb

input:

11
100000
1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 4 2 1 1 2 1 1 1 1 1 2 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 1 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 2 1 1 3 4 2 2 1 1 1 1 2 2 1 1 1 ...

output:

76221 1
50830 1
72471 1
72471 1
54048 1
54048 1
54048 1
22048 1
16493 1
47298 1
50708 1
26958 1
38307 1
33000 1
no
33000 1
33000 1
33000 1
14143 1
33000 1
23657 1
12221 1
no
12093 1
12221 1
12157 1
12208 1
12221 1
12073 1
12221 1
12221 1
2
12221 1
5907 1
12221 1
11458 1
12221 1
12221 1
11073 1
12208...

result:

ok 191357 tokens

Test #12:

score: 5
Accepted
time: 636ms
memory: 27980kb

input:

12
100000
1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 4 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 3 3 1 1 1 3 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 4 ...

output:

64431 1
61681 1
2343 1
3
43431 1
43431 1
43431 1
34516 1
13424 1
43431 1
43431 1
43431 1
21116 1
15931 1
9601 1
43431 1
14281 1
34223 1
34223 1
34223 1
28030 1
28030 1
22280 1
22280 1
18969 1
12780 1
3
15719 1
15719 1
14280 1
9181 1
1767 1
3128 1
14280 1
15719 1
12455 1
14280 1
15719 1
12530 1
15719...

result:

ok 191360 tokens

Test #13:

score: 5
Accepted
time: 631ms
memory: 28044kb

input:

13
100000
1 1 1 1 1 1 4 1 1 1 4 2 1 1 2 1 1 1 1 1 2 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 1 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 2 1 1 3 4 2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 4 1 1 3 1 1 1 1 ...

output:

46658 1
52000 1
yes
17323 1
47823 1
47823 1
41266 1
14143 1
41266 1
27407 1
27407 1
no
13016 1
27407 1
18907 1
15987 1
19753 1
12073 1
19954 1
19954 1
4
19954 1
5907 1
19611 1
15987 1
19954 1
19954 1
15954 1
19954 1
8
14861 1
13
7407 1
4664 1
5959 1
19954 1
17204 1
2343 1
1
17204 1
14861 1
14477 1
1...

result:

ok 191356 tokens

Test #14:

score: 5
Accepted
time: 623ms
memory: 28256kb

input:

14
100000
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 3 3 1 1 1 3 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 4 2 1 1 2 1 1 1 1 1 2 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 ...

output:

70250 1
28488 1
24024 1
9601 1
40253 1
14281 1
29750 1
25473 1
28738 1
29750 1
29750 1
29750 1
29750 1
29750 1
12780 1
0
29738 1
19344 1
14753 1
12297 1
2253 1
5378 1
14280 1
19344 1
12455 1
14280 1
19344 1
12530 1
19344 1
14753 1
19344 1
19344 1
8738 1
14753 1
19344 1
14753 1
19344 1
no
9323 1
1934...

result:

ok 191360 tokens

Test #15:

score: 5
Accepted
time: 603ms
memory: 28044kb

input:

15
100000
5 1 1 1 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 1 2 1 1 3 4 2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 1 1 1 1 1 1 3 1 1 1 1 4 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 1 1 ...

output:

no
26093 1
71500 1
19840 1
39524 1
41208 1
13823 1
71500 1
55111 1
1
47611 1
6840 1
35861 1
25622 1
47611 1
24860 1
15954 1
24860 1
2
24860 1
0
8340 1
7664 1
5959 1
24860 1
24860 1
2343 1
7
24860 1
24860 1
24860 1
19516 1
9610 1
24860 1
24860 1
24860 1
10204 1
12360 1
9601 1
24860 1
11281 1
24860 1
...

result:

ok 191357 tokens

Test #16:

score: 5
Accepted
time: 632ms
memory: 28108kb

input:

16
100000
1 1 1 1 1 1 1 3 3 1 1 1 3 1 1 1 1 1 1 1 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 3 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 1 1 1 1 1 2 1 1 3 1 1 1 1 1 1 1 1 1 1 1 1 4 1 1 1 4 2 1 1 2 1 1 1 1 1 2 1 1 1 4 1 1 1 1 1 1 1 1 1 1 1 2 5 1 1 1 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 1 1 1 ...

output:

73250 1
73250 1
65250 1
17300 1
5
46378 1
46378 1
39293 1
15297 1
2253 1
5378 1
22245 1
46378 1
12455 1
32398 1
46378 1
26208 1
37676 1
37676 1
37676 1
37676 1
7675 1
37676 1
33926 1
33926 1
24426 1
no
9323 1
24426 1
19344 1
19344 1
7142 1
19344 1
19344 1
19344 1
no
6343 1
19344 1
10844 1
15987 1
15...

result:

ok 191358 tokens

Test #17:

score: 5
Accepted
time: 624ms
memory: 28188kb

input:

17
100000
5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 2 1 5 2 1 5 3 2 5 1 ...

output:

14991 1
14991 1
0
14991 1
14991 1
14991 1
14991 1
9321 1
14991 1
85 1
14991 1
14991 1
3389 1
14991 1
14991 1
8171 1
14991 1
14991 1
14991 1
7300 1
1
14991 1
3241 1
14991 1
14991 1
14991 1
3078 1
14991 1
14991 1
1
14991 1
14991 1
8171 1
13776 1
2319 1
no
11969 1
11156 1
11969 1
8324 1
8324 1
8324 1
y...

result:

ok 191357 tokens

Test #18:

score: 5
Accepted
time: 627ms
memory: 28016kb

input:

18
100000
4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 3 2 3 4 5 4 2 2 1 1 ...

output:

6664 1
10003 376
10003 376
10003 91
10003 91
1
10003 91
0
10003 91
4612 1
2737 1
10003 91
10003 91
2411 1
0
8229 1
8229 1
8229 1
7466 1
8229 1
7466 1
7466 1
7466 1
7466 1
5884 1
6935 1
7466 1
7125 1
7466 1
7466 1
7466 1
7466 1
7466 1
7125 1
7125 1
7125 1
7125 1
2156
7125 1
7125 1
7125 1
3133 1
1693 ...

result:

ok 191358 tokens

Test #19:

score: 5
Accepted
time: 676ms
memory: 28220kb

input:

19
100000
1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 5 5 1 4 5 1 5 2 4 3 ...

output:

5837 1
7018 1
6352 1
7018 1
6352 1
7018 1
1
7018 1
7018 1
7018 1
7018 1
7018 1
5837 1
5837 1
7018 1
6549 1
5837 1
5565 1
5837 1
4716 1
7018 1
5074 1
7018 1
4979 1
1478
6948 1
no
4716 1
6948 1
6948 1
6726 1
6948 1
5837 1
5837 1
5837 1
5837 1
4076 1
no
5837 1
5837 1
5837 1
85 1
5837 1
5837 1
4288 1
49...

result:

ok 191356 tokens

Test #20:

score: 5
Accepted
time: 600ms
memory: 28016kb

input:

20
100000
2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 5 5 3 5 2 2 1 3 1 3 ...

output:

1608 1
no
10002 1
4364 1
8329 1
10002 1
8329 1
10002 1
no
2957 1
10002 1
10002 1
10002 1
6406 1
10002 1
10002 1
10002 1
no
5719 1
10002 1
6406 1
6406 1
5719 1
3748 1
10002 1
10002 1
0
10002 1
3316 1
5719 1
5719 1
10002 1
10002 1
6162 1
10002 1
0
5719 1
0
4726 1
2804 1
2895 1
10002 1
10002 1
1223 1
1...

result:

ok 191355 tokens

Extra Test:

score: 0
Extra Test Passed