QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#478670#4929. Longest Unfriendly SubsequenceZhaoZiLong13 77ms13680kbC++17654b2024-07-15 09:39:012024-07-15 09:39:02

详细

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 50ms
memory: 4356kb

input:

1
200000
259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 259021863 2...

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 73ms
memory: 13680kb

input:

1
200000
1521 1638 11981 18811 20091 22081 30494 31501 42139 42282 48197 55520 57632 69584 81745 85026 90303 91482 92176 98507 108061 108743 111257 121226 127217 127449 137116 163474 169192 175764 181243 185402 191244 198775 202845 212156 217723 220058 223478 224205 227614 228398 230425 232567 24480...

output:

198858

result:

ok single line: '198858'

Test #3:

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

input:

1
200000
222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 222796328 2...

output:

3

result:

ok single line: '3'

Test #4:

score: 0
Accepted
time: 51ms
memory: 4568kb

input:

1
200000
760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 760101 7601...

output:

575

result:

ok single line: '575'

Test #5:

score: 0
Accepted
time: 77ms
memory: 10696kb

input:

1
200000
22617 30507 37038 41687 43064 43064 49267 55626 59203 73739 82817 99920 109370 115622 115622 121135 121135 129717 129717 133074 133133 133133 142580 142580 142580 154213 154816 154816 161169 180270 186425 208068 213631 237721 252184 261468 266076 271129 271129 272992 278768 279170 299395 31...

output:

136202

result:

ok single line: '136202'

Test #6:

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

input:

5
24325
558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 558278563 55...

output:

3
143
605
169
1

result:

ok 5 lines

Test #7:

score: 0
Accepted
time: 63ms
memory: 7136kb

input:

5
86417
13696 27186 31482 38856 51078 60129 60129 63547 67673 87520 97892 99326 118061 118645 146408 154082 166604 178823 201607 241484 250276 265112 265112 265112 266533 267321 312070 312070 314782 320641 321224 325817 328085 351487 365110 374487 382485 385081 393245 400245 419177 421858 423028 426...

output:

68280
264
2
26943
5

result:

ok 5 lines

Test #8:

score: 0
Accepted
time: 45ms
memory: 3952kb

input:

5
2977
112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112394126 112...

output:

5
2
186
403
3

result:

ok 5 lines

Test #9:

score: 0
Accepted
time: 53ms
memory: 4820kb

input:

20
11481
2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 2249526 224...

output:

84
1
6616
5
157
3
4
173
2652
64
73
2669
97
22009
20
36
4231
33
1
8816

result:

ok 20 lines

Test #10:

score: 0
Accepted
time: 52ms
memory: 4188kb

input:

100
1273
276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 276188388 2...

output:

4
3
2906
3
2038
1262
2671
102
1
3
771
34
58
30
2
300
21
106
1
1
72
1
22
1123
5
547
5182
2
87
85
4
1370
158
74
2
1098
61
1027
11
82
1
377
2
715
5
52
67
3
472
158
1
58
6836
75
712
2
59
2
4
52
16
5
2
78
273
4281
36
1178
60
16
2
22
421
5
11
11
33
5
74
3
2
3
3
1770
5
2172
5
67
5
4
480
514
5
57
461
39
5
3...

result:

ok 100 lines

Test #11:

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

input:

1000
309
4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 4317803 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 49219507 134343195 241438227 241438227 241438227 241438227 241...

output:

19
4
52
20
182
1
4
91
4
84
2
121
18
14
1
22
9
10
2
7
150
9
76
9
5
5
10
17
46
2
25
17
4
40
397
13
157
12
5
5
78
6
99
3
287
20
86
26
16
8
24
329
28
11
4
9
4
4
10
182
35
20
117
41
1
5
54
1
713
111
8
5
4
2
18
3
38
72
8
1
17
3
2
9
14
25
5
3
2
15
140
6
7
173
81
5
30
2
5
2
8
52
3
16
58
2
146
8
31
4
458
2
1...

result:

ok 1000 lines

Test #12:

score: 0
Accepted
time: 55ms
memory: 3576kb

input:

10000
13
116636133 116636133 206284888 206284888 565476781 812400365 812400365 961195858 961195858 961195858 961195858 961195858 961195858
2
8191780 8191780
43
95905577 95905577 95905577 95905577 95905577 95905577 487815159 487815159 602877460 602877460 602877460 602877460 602877460 602877460 602877...

output:

5
1
8
2
3
10
13
1
2
2
4
2
2
1
5
1
21
3
1
11
13
1
9
1
2
1
2
3
1
8
6
3
26
2
2
3
26
1
15
2
8
1
1
11
9
2
6
2
2
2
10
6
3
8
5
3
2
6
6
16
5
5
2
11
6
1
3
1
1
2
32
5
9
1
1
11
8
3
1
1
3
3
1
3
26
1
43
1
10
1
8
2
1
1
3
21
30
5
19
1
5
16
2
18
1
1
1
13
3
3
4
3
23
3
3
2
1
10
1
13
2
1
14
4
1
3
7
1
1
1
1
2
14
3
5
5
...

result:

ok 10000 lines

Test #13:

score: 0
Accepted
time: 76ms
memory: 3816kb

input:

30000
18
77687359 77687359 77687359 77687359 77687359 77687359 77687359 77687359 264737334 264737334 264737334 264737334 423170703 423170703 423170703 423170703 423170703 423170703
3
426699491 894864848 895502688
23
329836738 329836738 329836738 329836738 329836738 329836738 329836738 329836738 3298...

output:

3
3
4
2
1
4
3
1
5
1
2
2
2
5
2
3
2
1
10
1
2
3
1
4
1
2
1
4
5
2
4
3
3
1
1
1
4
5
1
2
1
6
4
1
10
10
24
1
15
1
1
1
2
1
8
7
1
1
2
3
4
4
4
2
4
3
5
3
5
2
5
15
2
1
1
2
1
1
1
3
5
4
11
1
2
2
7
4
2
1
9
1
1
1
3
1
3
2
1
5
1
2
10
3
4
1
5
8
1
3
7
4
1
1
1
1
2
4
5
3
3
1
1
1
2
2
3
3
5
5
2
4
11
2
2
1
1
5
2
1
1
2
5
5
4
4...

result:

ok 30000 lines

Test #14:

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

input:

1
10000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

1

result:

ok single line: '1'

Subtask #2:

score: 0
Wrong Answer

Test #15:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

3
5
1 2 1 2 1
7
1 2 3 2 1 2 3
8
1 10 10 1 1 100 100 1

output:

2
6
1

result:

wrong answer 3rd lines differ - expected: '4', found: '1'

Subtask #3:

score: 0
Wrong Answer

Test #19:

score: 0
Wrong Answer
time: 0ms
memory: 3580kb

input:

1
500
537076440 691668159 871942500 537076440 537076440 691668159 871942500 871942500 537076440 691668159 871942500 537076440 691668159 871942500 537076440 691668159 871942500 537076440 691668159 871942500 537076440 691668159 871942500 871942500 537076440 691668159 871942500 537076440 537076440 6916...

output:

0

result:

wrong answer 1st lines differ - expected: '361', found: '0'

Subtask #4:

score: 10
Accepted

Test #79:

score: 10
Accepted
time: 23ms
memory: 4316kb

input:

1
200000
1 3 3 2 2 3 3 1 2 3 1 1 3 3 3 2 1 1 2 3 2 1 3 3 3 1 2 2 1 3 1 2 1 2 3 2 3 3 2 2 3 2 3 2 3 1 1 1 1 1 3 1 3 2 3 3 3 3 1 3 2 1 3 2 3 2 3 1 1 1 1 3 3 2 3 2 1 2 2 3 2 3 2 2 2 2 2 2 3 2 1 2 2 1 1 3 2 1 2 1 1 3 3 3 2 1 2 2 2 1 3 3 2 3 2 1 3 3 2 2 1 3 1 3 2 1 2 3 2 1 2 3 2 2 3 2 1 2 1 1 1 1 1 1 1 3...

output:

66691

result:

ok single line: '66691'

Test #80:

score: 0
Accepted
time: 23ms
memory: 4248kb

input:

1
200000
2 2 3 3 3 2 1 2 1 1 1 3 3 2 3 3 1 3 2 3 3 3 2 1 2 2 2 2 1 1 2 2 1 3 1 3 1 3 3 1 2 1 1 2 1 1 2 1 1 1 1 2 2 1 3 2 3 3 2 3 2 3 1 1 1 1 2 3 1 2 1 1 2 3 2 3 3 2 1 2 1 1 3 3 3 1 2 3 1 3 1 3 1 1 2 1 3 2 1 1 3 2 1 1 3 2 3 2 3 2 1 3 2 2 2 1 2 2 1 3 3 1 3 1 2 3 1 1 2 2 2 1 3 1 1 3 3 2 3 2 1 3 1 1 1 3...

output:

66403

result:

ok single line: '66403'

Test #81:

score: 0
Accepted
time: 22ms
memory: 4240kb

input:

1
200000
1 2 3 3 1 2 3 3 1 2 3 1 1 2 3 1 2 3 1 2 2 3 1 2 2 3 3 3 1 2 3 3 1 2 3 3 1 1 2 2 3 3 1 2 3 3 1 1 2 3 1 2 2 3 3 1 2 3 1 1 1 1 2 3 3 1 2 2 3 1 1 1 2 2 3 3 1 1 1 2 2 3 1 1 2 3 3 1 1 2 3 1 2 3 1 2 3 3 1 1 2 3 1 1 1 1 2 3 1 2 3 3 1 2 2 2 2 2 3 1 1 2 3 1 2 2 3 1 2 3 3 1 2 2 3 1 2 3 1 1 1 2 2 3 1 2...

output:

113082

result:

ok single line: '113082'

Test #82:

score: 0
Accepted
time: 23ms
memory: 4572kb

input:

1
200000
2 3 3 1 2 2 2 3 1 1 2 3 1 2 2 3 3 1 2 3 3 3 3 3 3 1 2 3 1 2 3 3 1 2 2 3 3 1 2 3 3 3 1 2 2 3 3 3 1 2 2 3 3 3 3 3 1 1 2 3 1 2 3 3 1 1 2 2 3 1 1 1 1 2 3 1 2 2 3 3 3 1 2 3 1 1 2 2 3 1 1 1 1 2 2 3 3 3 3 1 1 2 3 1 2 3 1 1 1 2 3 3 1 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 2 3 3 1 2 2 3 3 1 1 1 2 2 3 1 1 1 2...

output:

98984

result:

ok single line: '98984'

Test #83:

score: 0
Accepted
time: 23ms
memory: 4320kb

input:

1
200000
3 2 2 2 1 1 2 2 2 1 3 2 3 3 3 1 3 1 3 3 2 1 1 2 1 2 3 2 2 3 1 3 3 2 3 2 3 3 3 2 3 2 3 3 3 3 1 2 3 2 2 1 1 2 3 1 3 1 1 2 1 2 1 1 1 3 3 1 3 2 2 2 1 1 2 3 3 3 1 3 3 3 1 3 2 2 1 3 3 1 3 3 1 3 3 1 3 1 1 1 3 2 3 1 3 1 3 3 3 2 2 2 3 3 2 1 2 1 3 3 2 1 1 3 1 2 2 1 3 1 2 2 3 2 1 2 2 1 3 2 3 3 3 1 1 2...

output:

66809

result:

ok single line: '66809'

Test #84:

score: 0
Accepted
time: 24ms
memory: 4588kb

input:

1
200000
3 1 3 1 3 1 2 1 2 2 3 1 3 2 3 1 1 3 1 3 2 3 3 3 3 1 1 1 2 2 1 1 3 1 2 2 2 1 2 1 1 2 3 2 2 1 3 2 2 2 3 1 1 2 3 1 3 2 1 1 3 1 1 3 1 2 3 1 2 1 2 1 1 1 3 1 1 1 1 3 2 1 2 3 3 2 2 3 1 1 2 1 1 2 1 3 1 3 3 1 1 1 1 1 3 2 3 2 3 1 3 2 1 3 1 3 2 1 1 1 3 2 1 1 3 1 3 3 3 2 2 3 1 3 1 1 3 3 3 2 1 3 3 1 1 1...

output:

66929

result:

ok single line: '66929'

Test #85:

score: 0
Accepted
time: 21ms
memory: 4356kb

input:

1
200000
1 2 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 2 3 1 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 3 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 1 2 2 3 1 2 3 1 2 3 1 2 3 1 1...

output:

165153

result:

ok single line: '165153'

Test #86:

score: 0
Accepted
time: 20ms
memory: 4288kb

input:

1
200000
3 1 2 3 1 2 3 1 2 3 3 1 2 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2...

output:

161302

result:

ok single line: '161302'

Test #87:

score: 0
Accepted
time: 21ms
memory: 4136kb

input:

3
14732
1 3 2 1 3 3 1 1 3 2 1 2 1 1 1 3 1 3 1 1 3 2 1 1 3 2 3 3 2 1 3 3 3 3 1 1 1 2 3 2 1 3 3 3 1 2 1 1 3 1 1 2 2 1 3 3 3 2 3 2 1 2 2 3 1 3 3 2 2 3 1 2 1 1 3 2 2 2 1 2 3 3 1 3 3 2 1 1 1 1 2 1 3 1 2 3 3 2 2 1 3 3 3 2 2 2 1 1 1 1 1 2 1 2 1 3 2 2 1 3 2 3 2 3 3 1 3 1 1 2 1 1 2 1 1 3 2 1 2 3 2 1 3 1 3 3 ...

output:

4957
130118
23430

result:

ok 3 lines

Test #88:

score: 0
Accepted
time: 22ms
memory: 3904kb

input:

3
46973
1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 ...

output:

35431
19615
37542

result:

ok 3 lines

Test #89:

score: 0
Accepted
time: 22ms
memory: 3940kb

input:

3
19336
2 3 1 2 2 3 1 1 2 3 3 1 2 2 2 3 3 3 1 2 3 1 2 2 3 3 3 1 1 1 1 1 2 2 3 3 3 3 1 1 1 2 2 2 2 3 1 1 1 1 2 2 2 3 3 3 3 1 1 2 2 2 3 1 2 3 1 2 2 3 3 3 1 2 3 1 2 3 1 2 3 3 1 1 2 3 3 1 2 2 2 2 2 2 3 3 1 2 3 1 2 2 3 3 1 1 1 1 2 3 1 1 1 1 1 2 2 2 2 2 2 3 3 3 1 2 3 1 2 3 3 1 2 3 3 3 3 3 3 1 2 2 2 2 2 2 ...

output:

8087
53502
40182

result:

ok 3 lines

Test #90:

score: 0
Accepted
time: 18ms
memory: 4032kb

input:

3
111453
2 3 2 2 3 2 2 2 1 1 1 2 2 2 3 2 2 1 3 1 3 3 1 3 2 2 1 3 1 2 2 2 3 1 3 2 1 2 1 1 3 3 1 1 3 1 1 2 1 2 1 1 1 3 3 3 1 1 1 3 2 2 1 3 2 1 1 3 1 2 3 3 1 2 2 2 1 3 2 2 2 2 2 2 2 3 2 1 3 1 2 1 3 1 1 1 2 3 3 1 3 2 1 3 2 2 2 3 1 3 3 3 2 1 3 2 1 3 2 1 3 3 3 1 1 2 1 2 1 3 2 2 2 3 3 1 2 1 2 2 3 3 2 2 2 2...

output:

37432
9380
2

result:

ok 3 lines

Test #91:

score: 0
Accepted
time: 19ms
memory: 4372kb

input:

1
200000
1 2 3 1 2 3 1 2 3 3 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2...

output:

161232

result:

ok single line: '161232'

Test #92:

score: 0
Accepted
time: 19ms
memory: 4588kb

input:

1
200000
2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2...

output:

177380

result:

ok single line: '177380'

Test #93:

score: 0
Accepted
time: 21ms
memory: 4356kb

input:

1
200000
3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 3 2 2 1 3 2 1 3 2 1 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 3 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1...

output:

152945

result:

ok single line: '152945'

Test #94:

score: 0
Accepted
time: 20ms
memory: 4288kb

input:

1
200000
3 2 1 3 1 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 3 3 3 3 2 2 1 3 2 1 3 3 2 1 3 2 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 1 3 2 2 1 3 2 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 2 1 3 2 1 3 2...

output:

139711

result:

ok single line: '139711'

Test #95:

score: 0
Accepted
time: 20ms
memory: 4360kb

input:

1
200000
2 3 3 1 2 3 1 2 2 1 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 2 3 1 2 3 1 2 3 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 1 2 3...

output:

159913

result:

ok single line: '159913'

Test #96:

score: 0
Accepted
time: 16ms
memory: 4320kb

input:

1
200000
3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 2 2 3 1 2 3 1 2 3 1 2 3 1 1 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 3 1 2 2 3 1 2 3 1 2 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 2 3 1...

output:

164070

result:

ok single line: '164070'

Test #97:

score: 0
Accepted
time: 21ms
memory: 4288kb

input:

1
200000
1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 2 1 3 3 2 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 2 2 1 3 2 1 1 3 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 3 2 1 1 3 2 1 3 2 1 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 1 3...

output:

141972

result:

ok single line: '141972'

Test #98:

score: 0
Accepted
time: 19ms
memory: 4356kb

input:

1
200000
1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 3 2 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2...

output:

180569

result:

ok single line: '180569'

Test #99:

score: 0
Accepted
time: 19ms
memory: 4072kb

input:

3
67258
1 3 2 1 3 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 2 1 3 2 1 ...

output:

55713
10294
102575

result:

ok 3 lines

Test #100:

score: 0
Accepted
time: 21ms
memory: 4240kb

input:

3
110746
2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 1 2 3 3 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 2 3 3 1 2 3 1 2 3 1 2 3 1 1 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2...

output:

78787
56073
17413

result:

ok 3 lines

Test #101:

score: 0
Accepted
time: 21ms
memory: 3936kb

input:

3
88522
1 2 2 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 3 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 1 2 3 1 2 2 3 1 2 3 3 1 2 3 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 1 2 3 3 1 1 1 2 3 1 2 3 1 ...

output:

72954
15040
67627

result:

ok 3 lines

Test #102:

score: 0
Accepted
time: 20ms
memory: 4092kb

input:

3
38399
2 1 1 3 2 1 3 2 1 3 3 3 2 1 3 2 1 3 3 2 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 3 2 1 1 1 3 2 1 3 2 1 3 3 3 2 2 2 1 3 2 1 3 3 2 1 1 1 3 2 1 3 2 1 3 2 2 1 3 2 2 1 3 2 1 3 2 1 3 2 ...

output:

27852
58832
74901

result:

ok 3 lines

Test #103:

score: 0
Accepted
time: 22ms
memory: 3860kb

input:

10
23759
3 2 1 2 1 2 1 2 2 2 2 1 1 1 3 1 3 1 3 3 2 1 1 3 3 2 3 2 2 1 3 2 3 3 2 1 3 1 2 3 3 3 2 1 1 3 3 1 2 3 3 2 3 3 1 2 3 3 2 2 1 2 3 2 3 1 1 3 3 3 2 3 3 3 1 1 3 2 3 2 2 3 2 1 1 1 1 2 1 3 3 1 3 2 3 3 1 3 3 1 1 2 3 1 3 2 3 3 2 2 3 1 3 3 2 3 1 3 2 3 3 3 1 2 3 2 3 1 3 1 3 2 2 3 3 2 1 2 2 2 3 1 2 2 2 2...

output:

8049
15976
3898
1817
4647
15431
43707
2827
2372
17780

result:

ok 10 lines

Test #104:

score: 0
Accepted
time: 21ms
memory: 3952kb

input:

15
3978
2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 3 1 2 2 2 3 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 1 1 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 2 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 1 1 2 3 3 3 1 2 3 1 ...

output:

2648
2
12485
3542
2427
2686
13541
17826
1973
10284
16751
13183
2992
4312
643

result:

ok 15 lines

Test #105:

score: 0
Accepted
time: 22ms
memory: 3700kb

input:

20
2162
3 2 3 1 2 2 3 3 1 1 1 2 2 2 3 3 2 2 1 3 2 1 3 3 3 3 2 1 2 1 1 1 3 1 1 2 2 1 2 3 3 2 3 1 1 1 1 3 3 1 3 3 1 1 2 3 3 1 2 2 3 3 2 3 2 3 3 2 2 2 1 1 3 3 2 2 1 3 3 2 3 3 1 1 3 2 2 2 1 2 3 1 3 3 3 1 2 2 2 1 1 1 2 2 3 1 1 3 3 1 3 2 3 1 1 1 2 1 3 1 3 3 2 1 1 2 1 1 3 1 1 2 2 3 2 2 2 1 3 3 3 3 3 2 1 1 ...

output:

754
605
5276
265
12917
210
69
4263
11833
610
2550
5415
3601
12242
4287
5965
1729
16708
1764
1028

result:

ok 20 lines

Test #106:

score: 0
Accepted
time: 22ms
memory: 3680kb

input:

50
3286
2 3 1 2 2 1 2 1 2 2 1 1 2 3 2 3 3 1 3 1 1 1 1 3 3 1 3 3 3 1 2 2 2 2 1 1 1 2 3 1 2 1 2 1 2 3 1 3 1 1 1 1 2 1 3 1 2 2 1 2 1 2 3 3 1 2 1 2 1 2 1 2 2 2 2 2 1 2 3 1 2 1 1 3 2 3 1 1 3 2 1 2 1 1 1 2 2 3 1 1 3 1 1 2 2 3 1 2 2 3 2 3 3 2 1 2 3 3 2 3 1 3 2 2 2 3 3 3 1 2 3 3 3 3 2 3 2 1 2 1 2 1 3 1 2 3 ...

output:

1094
2039
1266
311
3566
734
3452
921
6366
1785
1886
46
250
1156
2209
480
856
891
1475
1903
98
1610
6239
2069
1169
4200
1325
2769
31
956
206
4259
6816
2833
474
3248
818
2818
1
398
160
54
1866
4308
3127
5468
1697
282
1209
1567

result:

ok 50 lines

Test #107:

score: 0
Accepted
time: 22ms
memory: 3776kb

input:

100
1
2
8738
3 3 3 2 2 3 2 1 1 2 2 2 3 2 2 1 1 3 2 2 3 2 3 1 3 3 1 3 2 2 1 1 3 2 1 1 3 1 1 1 1 2 2 2 2 1 3 3 2 2 1 2 1 2 1 1 2 2 1 1 2 2 1 2 3 1 1 3 2 2 1 1 3 1 2 3 2 1 3 1 1 1 3 2 1 3 3 3 2 3 3 3 1 2 1 3 3 1 2 3 2 1 3 3 3 3 1 1 3 2 1 1 2 2 2 2 2 1 3 1 2 3 3 3 2 1 3 3 1 3 2 3 2 1 2 3 1 1 2 2 3 3 2 2...

output:

1
2913
447
199
486
258
178
1822
6779
5048
3183
250
179
1857
719
194
98
510
6409
137
388
186
2
85
705
90
155
2627
766
203
413
550
1863
1
515
97
475
1
21
1282
1064
2382
471
276
557
137
112
225
185
921
1869
4
1877
84
353
1369
1175
717
2
507
1358
328
762
525
239
223
49
189
621
1229
427
911
830
2306
3726...

result:

ok 100 lines

Test #108:

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

input:

200
799
2 2 1 1 2 3 3 2 2 2 2 2 1 2 3 3 2 3 3 3 1 3 1 1 2 3 1 3 1 1 3 2 1 3 3 1 3 2 1 1 3 3 1 3 2 1 2 3 3 2 3 3 2 1 2 1 2 2 3 2 1 1 2 1 1 1 1 3 1 2 2 1 3 3 3 3 3 3 2 1 1 3 2 1 2 1 3 1 1 2 3 1 1 1 2 1 1 1 1 1 2 2 3 2 1 2 2 2 2 1 1 3 2 3 2 2 2 2 2 3 2 3 2 2 2 3 2 1 3 3 2 2 3 1 2 2 1 1 1 2 3 1 2 1 3 2 ...

output:

272
219
2
866
1052
234
752
479
66
608
263
503
2073
36
231
1498
315
29
116
514
589
168
905
15
985
18
148
657
2668
1219
580
210
1025
6
41
552
565
181
1702
386
371
154
25
268
2
466
75
151
26
1010
92
700
2157
594
2
1081
168
801
197
157
41
211
902
499
1177
465
101
95
142
500
616
200
51
244
172
630
83
918...

result:

ok 200 lines

Test #109:

score: 0
Accepted
time: 22ms
memory: 3584kb

input:

500
34
2 2 2 2 2 3 3 3 1 2 3 3 1 1 1 2 1 1 3 3 3 3 2 1 3 2 2 2 1 1 3 3 2 1
7
2 1 2 1 1 2 2
333
3 2 1 2 1 1 3 1 1 2 1 2 3 3 3 2 2 1 1 1 1 2 1 3 1 3 1 2 2 2 2 1 3 1 3 3 1 2 3 2 3 1 3 3 3 2 3 1 2 2 1 1 2 3 2 2 3 2 1 3 1 2 1 1 3 1 3 1 2 1 2 2 3 1 1 3 2 2 2 3 2 1 3 1 2 1 3 3 1 3 3 2 2 2 3 2 1 1 3 2 2 3 1...

output:

14
2
124
74
641
27
298
259
91
99
36
568
75
34
164
52
380
59
264
168
88
218
31
89
123
277
23
178
52
439
189
2
162
411
68
1733
348
2
52
354
38
265
10
179
2
80
222
46
298
207
69
547
83
77
117
110
19
414
237
97
111
88
89
36
139
214
266
429
37
629
129
169
42
22
4
84
91
32
231
43
141
168
336
49
40
248
6
4...

result:

ok 500 lines

Test #110:

score: 0
Accepted
time: 19ms
memory: 3808kb

input:

1000
294
3 3 1 1 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 1 2 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 3 1 2 3 1 1 2 3 1 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3...

output:

259
87
166
81
32
102
157
101
53
79
126
39
20
50
17
82
23
41
21
70
95
1
14
38
4
116
52
243
21
136
55
1
1
127
12
59
86
52
106
223
12
6
223
23
12
166
50
11
2
152
51
220
13
59
53
10
174
94
14
333
11
70
89
7
111
5
178
31
89
81
44
25
70
449
7
180
45
122
134
113
138
41
2
1
93
59
21
11
113
55
43
100
12
103
...

result:

ok 1000 lines

Test #111:

score: 0
Accepted
time: 28ms
memory: 3508kb

input:

10000
99
2 3 3 1 2 3 3 3 1 2 3 1 2 3 3 3 1 2 2 2 3 1 2 3 1 1 2 3 1 2 2 3 1 2 3 3 1 2 2 2 2 3 1 2 3 3 3 1 2 2 3 1 2 3 3 3 3 1 2 3 1 2 2 2 3 1 1 2 3 1 2 3 3 3 1 2 3 1 2 2 3 3 3 3 1 1 1 1 1 1 2 2 2 3 3 3 1 1 2
9
3 1 2 3 3 1 2 1 3
50
3 3 1 2 3 2 1 3 2 1 3 2 1 3 3 2 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 2 2 ...

output:

61
7
40
60
3
5
1
1
6
2
6
6
1
16
2
14
1
4
3
1
15
5
14
15
3
26
2
5
12
23
5
3
2
9
4
4
2
40
8
25
8
14
5
11
4
11
8
7
2
12
3
4
10
22
16
4
40
2
8
32
24
8
27
22
37
1
2
3
7
15
2
8
6
12
22
4
9
7
12
8
12
3
25
12
5
6
7
6
17
8
6
8
13
2
22
32
5
16
2
4
5
1
5
2
19
2
6
19
28
3
2
2
10
25
17
10
8
4
2
12
7
15
5
5
32
14...

result:

ok 10000 lines

Test #112:

score: 0
Accepted
time: 35ms
memory: 3584kb

input:

20000
9
3 3 2 3 2 2 3 1 2
9
1 1 1 2 2 3 3 2 3
5
2 3 2 1 1
6
2 2 1 2 3 1
7
2 2 2 2 1 3 3
1
1
8
2 1 3 2 2 1 3 2
14
3 3 1 3 2 3 3 1 3 1 3 3 2 3
5
1 2 1 1 1
5
3 2 1 1 2
9
3 2 1 1 1 2 3 1 3
7
1 1 2 3 1 1 1
1
2
5
3 2 1 1 2
29
3 1 1 2 2 1 1 2 3 3 3 1 1 3 2 1 2 3 3 1 3 3 2 3 1 3 3 1 2
6
3 3 1 2 3 1
12
2 3 1...

output:

4
3
3
4
3
1
7
7
2
3
5
4
1
3
12
5
5
8
17
2
2
27
8
10
51
11
4
14
2
3
7
10
6
2
2
4
4
5
5
18
7
1
6
3
2
2
3
2
7
3
5
4
9
1
3
2
1
25
5
9
2
4
4
5
6
2
3
1
2
2
8
2
4
1
20
5
6
1
2
5
2
7
1
3
2
1
6
9
10
4
2
6
16
2
2
1
1
5
11
4
5
4
1
11
1
6
6
14
2
3
8
2
11
12
4
3
14
25
18
2
2
4
16
6
4
3
9
3
1
3
2
5
9
15
5
18
5
6
...

result:

ok 20000 lines

Test #113:

score: 0
Accepted
time: 53ms
memory: 3512kb

input:

50000
5
3 1 3 2 2
1
1
1
3
6
2 1 1 3 3 2
9
3 3 1 1 2 1 3 2 3
1
2
8
2 2 2 2 3 3 2 1
2
1 2
2
3 2
2
2 1
1
1
2
1 3
3
1 3 2
6
3 1 1 1 1 3
4
2 2 2 3
6
1 1 1 2 1 1
3
3 3 1
15
2 3 1 2 3 1 2 3 1 3 2 1 3 2 2
1
3
4
2 1 3 2
2
1 2
4
1 1 2 1
2
2 1
2
1 3
1
2
5
3 3 2 2 1
5
2 3 3 2 3
3
2 2 1
1
2
6
2 3 3 3 3 2
3
2 1 3...

output:

3
1
1
4
5
1
3
2
2
2
1
2
3
2
2
2
2
11
1
4
2
2
2
2
1
3
2
2
1
2
3
1
2
2
1
3
2
5
3
2
2
3
3
4
3
4
1
6
2
4
2
5
3
3
1
1
2
9
3
1
2
3
2
5
2
2
2
3
8
2
2
9
2
1
1
1
3
3
8
2
2
1
2
9
3
1
2
1
7
2
2
2
2
2
1
7
1
2
2
5
2
6
8
3
4
2
1
4
3
9
1
4
1
4
2
3
4
1
1
5
2
2
2
2
1
5
2
7
3
5
5
1
1
2
1
1
2
1
1
1
5
3
1
3
2
1
4
1
1
4...

result:

ok 50000 lines

Test #114:

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

input:

1
10000
2 3 3 1 2 2 2 3 1 1 2 2 3 3 3 1 2 3 3 1 2 3 3 1 1 2 3 1 1 1 1 2 2 3 3 1 2 2 3 1 1 2 3 1 1 1 1 2 2 2 3 3 3 1 1 2 3 1 2 3 1 1 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 3 1 1 1 1 1 1 2 3 1 2 2 2 3 3 1 2 3 3 3 1 1 1 2 3 1 2 3 1 2 2 2 3 1 2 3 1 2 3 1 1 1 2 3 3 1 2 2 2 3 3 1 2 3 3 3 3 3 1 2 2 2 3 1 2 ...

output:

4765

result:

ok single line: '4765'

Test #115:

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

input:

1
10000
1 1 2 2 1 2 1 3 1 3 3 3 3 1 3 1 1 1 1 2 1 3 3 1 2 3 2 3 2 3 1 3 1 3 1 1 1 2 1 1 1 3 3 3 2 1 2 1 3 2 1 3 2 2 1 3 1 2 2 2 2 1 2 2 3 2 2 3 3 2 2 3 2 1 3 3 1 3 3 3 3 1 3 1 1 3 1 3 2 3 3 3 3 3 2 3 3 1 1 3 1 2 2 2 3 1 1 1 2 1 3 2 2 1 1 2 1 3 2 1 2 3 3 2 2 3 3 3 3 1 2 1 3 2 3 2 2 1 1 1 2 2 2 1 1 2 ...

output:

3368

result:

ok single line: '3368'

Test #116:

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

input:

3
2025
1 3 3 1 2 3 1 1 1 2 2 1 2 2 1 2 3 3 2 1 2 3 1 1 2 1 1 1 2 2 2 1 3 1 1 2 3 1 1 3 3 3 2 2 2 2 2 2 1 2 3 1 3 3 2 2 2 3 1 3 3 3 3 3 2 3 1 2 1 3 3 1 3 3 3 1 2 3 2 3 2 2 3 1 1 1 1 3 2 2 3 3 1 1 2 1 3 1 1 3 1 2 2 1 1 2 1 3 2 2 3 1 1 2 1 3 1 2 3 1 3 2 2 3 3 1 3 2 3 2 1 2 2 3 1 3 2 2 1 3 1 1 3 1 2 2 2...

output:

694
953
2972

result:

ok 3 lines

Test #117:

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

input:

20
518
3 3 2 1 1 1 3 1 3 2 1 3 1 2 1 1 3 3 2 3 1 3 1 1 2 1 3 3 2 1 3 2 2 1 3 1 2 3 3 1 2 1 3 1 2 3 3 1 1 2 2 1 3 1 3 2 2 1 2 2 3 1 2 2 2 1 3 3 3 3 1 1 3 3 3 3 1 1 1 2 2 2 3 3 1 3 3 1 1 3 3 2 2 3 3 3 2 3 2 1 1 3 1 3 2 3 2 2 2 1 2 2 1 1 3 2 1 1 3 1 2 3 2 1 3 2 2 1 3 2 1 2 3 2 1 2 2 2 3 1 1 2 2 3 2 3 3...

output:

175
118
279
482
208
59
2
210
44
352
188
87
364
62
155
134
10
1860
418
227

result:

ok 20 lines

Test #118:

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

input:

100
75
2 1 1 3 3 3 2 1 2 3 1 3 1 2 3 1 1 3 2 2 2 3 1 3 2 1 2 3 2 2 1 1 3 1 1 3 3 2 1 2 3 3 1 1 2 2 3 2 1 2 3 3 1 3 1 3 1 2 3 1 3 2 2 2 2 3 1 2 3 3 3 3 1 2 2
130
3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3...

output:

34
114
22
85
85
8
102
19
93
18
30
41
60
17
2
91
204
35
35
16
64
3
2
20
18
27
17
29
47
31
13
11
10
13
36
4
117
22
1
65
13
2
6
24
106
67
1
64
33
206
1
45
14
2
32
304
74
2
21
5
68
25
53
18
93
55
2
54
109
20
25
163
130
35
35
23
9
113
30
77
108
203
18
9
33
47
9
1
44
33
3
204
98
158
3
173
254
3
59
20

result:

ok 100 lines

Test #119:

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

input:

1
10000
2 2 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...

output:

7601

result:

ok single line: '7601'

Test #120:

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

input:

1
10000
1 2 3 1 2 2 1 2 2 3 1 1 2 3 3 1 2 3 1 2 3 3 1 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 1 2 3 1 2 3 1 2 3 1 2 3 3 1 2 3 3 1 2 3 1 2 3 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 3 1 2 2 3 1 2 3 1 2 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 2 3 1 2 2 3 1 2 3 ...

output:

7746

result:

ok single line: '7746'

Test #121:

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

input:

1
10000
3 2 3 3 2 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 1 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 1 3 2 2 1 3 2 1 3 2 1 3 2 1 3 2 1 3 2 1 1 3 2 ...

output:

8313

result:

ok single line: '8313'

Subtask #5:

score: 0
Wrong Answer

Dependency #4:

100%
Accepted

Test #122:

score: 0
Wrong Answer
time: 23ms
memory: 4364kb

input:

1
200000
5 3 10 4 3 4 10 4 3 6 9 2 4 3 2 10 8 6 2 9 1 8 7 10 4 2 1 5 8 5 10 8 2 9 2 1 3 2 8 9 3 5 4 9 8 7 9 4 3 10 5 3 3 10 8 4 7 10 7 8 2 1 8 4 6 7 8 6 5 10 4 5 10 5 10 8 1 4 8 6 2 8 9 3 7 8 4 8 6 5 1 5 9 8 10 4 2 5 4 1 8 10 3 8 10 3 1 9 8 7 9 3 7 2 6 3 6 2 2 8 8 1 10 2 3 9 10 2 8 1 9 10 8 3 7 6 3 ...

output:

20533

result:

wrong answer 1st lines differ - expected: '166092', found: '20533'

Subtask #6:

score: 0
Skipped

Dependency #3:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%