QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#302387#7604. Find the VertexmorikoAC ✓248ms54304kbC++141.4kb2024-01-10 20:19:362024-01-10 20:19:37

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 21936kb

input:

5 6
1 0 1 1 2
5 4
1 2
3 2
3 4
4 2
1 5

output:

2

result:

ok 1 number(s): "2"

Test #2:

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

input:

6 6
0 1 2 0 2 1
1 2
2 3
3 4
4 5
5 6
6 1

output:

1

result:

ok 1 number(s): "1"

Test #3:

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

input:

10 9
1 2 0 0 0 0 2 2 1 0
1 4
8 5
4 9
10 8
3 8
9 8
7 9
6 8
2 9

output:

4

result:

ok 1 number(s): "4"

Test #4:

score: 0
Accepted
time: 4ms
memory: 15328kb

input:

10 12
2 1 2 0 2 0 1 0 1 1
7 5
5 2
7 1
9 6
3 2
1 2
10 6
4 3
6 2
7 10
8 1
6 7

output:

6

result:

ok 1 number(s): "6"

Test #5:

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

input:

10 20
2 1 0 2 2 2 1 0 1 1
5 3
4 1
7 4
2 4
6 2
5 2
1 7
4 5
9 1
1 5
6 1
6 4
8 2
10 8
3 1
2 7
9 5
8 7
8 9
9 2

output:

8

result:

ok 1 number(s): "8"

Test #6:

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

input:

10 30
1 1 2 0 1 2 1 2 1 1
7 5
7 2
9 6
8 7
8 9
7 1
4 1
3 1
9 10
9 7
6 1
9 4
9 1
1 5
4 7
2 10
8 2
3 5
9 3
10 6
5 4
2 9
4 2
10 4
10 5
1 10
1 8
6 3
2 5
5 6

output:

4

result:

ok 1 number(s): "4"

Test #7:

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

input:

100 99
1 1 1 1 0 2 2 0 0 1 1 2 1 2 0 1 0 0 0 0 0 2 1 1 2 0 2 1 1 1 0 0 0 0 0 2 0 0 1 0 2 0 2 2 0 1 2 1 0 1 2 0 2 1 0 1 0 0 2 2 2 2 2 0 1 0 0 0 1 0 2 0 1 2 0 2 0 1 1 1 1 2 0 0 2 2 2 0 1 0 0 0 1 0 2 0 2 2 1 0
57 62
63 3
39 15
70 71
72 86
87 30
60 30
17 76
15 14
22 28
89 38
61 28
93 66
21 86
6 30
40 76...

output:

49

result:

ok 1 number(s): "49"

Test #8:

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

input:

100 120
0 0 0 2 0 1 2 0 2 1 2 2 0 1 2 2 2 2 1 2 0 0 1 0 2 1 2 2 0 0 0 0 2 2 0 2 2 0 1 1 0 1 2 1 0 0 2 0 1 1 2 1 2 2 1 0 2 0 2 1 2 0 1 1 2 1 0 2 1 1 2 0 2 1 2 2 0 1 2 1 1 2 1 0 1 2 0 2 2 0 0 0 1 0 2 1 2 2 1 1
28 31
77 53
6 2
53 41
44 2
73 42
79 72
59 39
20 59
34 50
47 96
30 54
98 69
93 45
43 10
95 93...

output:

1

result:

ok 1 number(s): "1"

Test #9:

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

input:

100 200
1 2 0 1 2 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 2 0 1 0 2 0 1 2 1 0 1 0 0 2 1 0 1 2 2 1 2 2 1 2 0 0 2 1 2 1 1 0 2 1 2 1 2 2 0 2 1 1 2 1 0 0 1 2 0 0 0 0 0 1 2 2 1 1 0 0 1 0 0 0 1 2 1 0 2 0 1 2 2 2 1 1 1 2
26 71
21 29
9 100
45 18
92 88
17 2
93 26
7 5
98 8
83 84
66 11
94 25
74 18
100 15
6 30
5 24
2...

output:

81

result:

ok 1 number(s): "81"

Test #10:

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

input:

100 300
2 1 2 0 1 0 0 0 0 0 2 0 0 1 0 2 0 1 0 0 0 0 2 2 2 0 0 0 1 0 0 2 0 2 0 0 0 2 0 2 0 1 0 1 0 1 0 0 0 0 2 2 2 2 0 0 0 0 2 1 0 2 0 1 0 2 2 0 0 1 2 1 2 0 1 2 1 2 2 2 2 0 2 0 0 2 2 0 0 1 2 0 0 0 2 0 2 1 0 1
62 50
75 13
21 48
4 76
84 87
1 13
18 39
95 58
38 87
19 15
96 58
50 18
52 56
96 7
47 33
74 27...

output:

65

result:

ok 1 number(s): "65"

Test #11:

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

input:

10000 9999
1 1 2 1 2 0 0 2 2 1 2 1 1 0 1 1 0 2 1 2 1 1 0 2 1 0 1 2 1 2 2 0 2 0 0 2 0 0 1 1 0 2 0 2 2 2 0 2 1 2 0 1 2 2 1 0 0 1 1 2 0 1 0 0 0 0 0 2 2 1 1 1 1 0 0 2 2 0 0 2 1 0 1 2 1 2 2 0 2 0 2 2 1 0 2 1 2 1 0 1 0 1 1 1 1 2 0 1 2 1 0 1 1 0 2 1 0 0 1 1 0 0 0 1 2 0 2 2 0 0 0 0 0 2 0 2 0 2 0 1 0 2 2 1 1...

output:

8495

result:

ok 1 number(s): "8495"

Test #12:

score: 0
Accepted
time: 4ms
memory: 15976kb

input:

10000 12000
2 0 1 0 1 0 2 2 1 2 2 2 0 0 0 0 2 0 0 1 1 2 1 1 2 2 1 2 0 1 2 2 0 1 1 1 0 0 2 1 0 1 1 0 0 1 1 2 1 0 0 2 1 0 2 1 2 0 0 2 1 1 1 0 0 0 1 0 0 0 0 1 1 2 0 1 2 0 0 2 1 0 2 1 1 1 1 2 0 0 0 0 2 2 2 0 1 0 0 2 1 1 2 1 1 1 2 2 2 1 1 2 0 2 0 1 1 0 2 0 1 0 0 1 2 2 1 2 0 1 2 1 0 1 2 0 2 1 1 0 2 1 1 2 ...

output:

6173

result:

ok 1 number(s): "6173"

Test #13:

score: 0
Accepted
time: 10ms
memory: 16340kb

input:

10000 20000
1 0 0 1 0 1 2 1 1 1 2 1 2 2 1 1 0 1 0 0 0 0 0 0 1 0 2 2 1 1 1 0 1 1 0 1 2 2 1 1 2 0 1 0 0 2 1 2 2 1 1 0 2 1 0 1 1 1 1 0 0 0 1 0 0 1 1 1 2 2 1 1 2 0 1 0 1 2 0 2 0 2 2 1 1 1 2 0 2 1 1 0 0 1 1 0 2 1 1 0 0 2 1 1 2 2 2 0 1 1 2 0 0 1 1 1 0 0 1 0 1 1 2 1 0 0 1 0 2 1 2 0 1 2 1 0 1 1 1 1 2 0 1 0 ...

output:

8707

result:

ok 1 number(s): "8707"

Test #14:

score: 0
Accepted
time: 8ms
memory: 16568kb

input:

10000 30000
0 0 2 1 2 2 2 1 2 0 2 0 1 2 0 2 0 1 2 2 2 2 0 0 2 2 2 2 2 2 2 2 2 1 0 1 0 2 2 0 2 2 2 2 2 2 1 2 0 1 1 1 0 0 0 2 2 1 2 0 1 2 0 2 1 2 1 0 2 2 1 0 0 0 2 1 2 0 1 2 2 2 0 0 2 2 1 2 2 0 0 2 0 2 2 2 2 0 2 1 2 0 0 0 0 2 0 1 2 0 2 2 2 0 2 2 2 2 2 0 2 2 2 2 2 0 0 0 0 1 2 2 2 2 0 0 0 2 0 2 2 0 1 0 ...

output:

3998

result:

ok 1 number(s): "3998"

Test #15:

score: 0
Accepted
time: 123ms
memory: 36728kb

input:

250000 249999
1 2 2 0 1 0 1 0 1 1 2 1 1 0 2 0 0 1 1 2 0 2 1 0 1 2 0 2 0 0 0 2 0 2 2 1 2 2 0 0 2 2 2 1 1 1 0 0 2 0 0 0 0 1 2 1 2 0 2 2 2 1 1 2 0 0 0 2 0 2 0 1 2 2 1 1 1 0 1 0 0 2 1 0 1 0 0 0 1 2 0 0 2 1 2 0 0 0 2 1 1 1 1 1 1 0 1 2 0 2 0 2 1 1 1 2 0 0 0 2 0 1 2 0 0 2 2 0 2 1 2 2 0 0 2 0 2 2 0 2 2 0 2 ...

output:

179952

result:

ok 1 number(s): "179952"

Test #16:

score: 0
Accepted
time: 117ms
memory: 39268kb

input:

250000 250000
1 2 2 0 0 1 1 1 2 0 0 0 2 1 2 1 0 1 0 2 2 1 0 1 2 1 0 0 1 2 2 2 1 0 2 1 1 1 0 0 0 1 2 1 0 0 1 0 1 1 2 2 2 2 1 2 1 1 0 1 1 0 1 0 1 1 1 2 2 2 0 0 1 0 0 0 0 2 0 1 1 0 0 0 0 2 1 0 2 2 2 2 1 0 2 2 0 2 0 0 0 2 1 0 2 0 0 1 2 0 2 0 2 0 1 1 2 2 2 2 0 0 2 0 2 1 1 1 1 2 1 2 2 1 1 0 1 1 1 2 2 2 0 ...

output:

160937

result:

ok 1 number(s): "160937"

Test #17:

score: 0
Accepted
time: 106ms
memory: 39564kb

input:

250000 252500
0 1 2 2 2 2 2 2 1 2 0 2 1 2 0 1 1 0 2 2 0 1 2 1 2 1 0 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 1 2 0 2 2 2 0 2 1 2 1 2 0 2 2 1 2 2 2 0 1 1 0 0 0 2 1 2 1 0 0 1 1 0 1 1 1 2 2 2 0 0 2 1 0 1 1 1 0 0 1 2 2 0 0 1 1 1 2 2 2 0 1 0 2 2 2 1 0 0 2 0 1 0 0 0 0 0 2 0 2 0 2 1 2 1 0 1 2 1 0 1 0 2 1 1 2 1 ...

output:

67589

result:

ok 1 number(s): "67589"

Test #18:

score: 0
Accepted
time: 108ms
memory: 38964kb

input:

250000 255000
1 1 2 0 2 0 1 2 1 1 1 2 2 1 0 1 1 2 2 2 0 2 0 1 0 0 0 2 0 1 2 1 2 2 2 1 2 2 0 2 1 2 0 0 0 1 1 1 1 2 1 0 1 2 1 1 2 2 1 0 0 1 1 2 0 1 2 0 1 0 1 2 2 0 2 1 2 1 0 1 0 0 2 1 2 0 1 1 2 1 0 2 0 0 1 2 0 1 1 2 0 0 2 2 0 2 1 0 0 1 0 1 2 1 2 2 1 1 2 2 0 1 2 2 2 0 2 1 0 2 0 1 1 0 0 2 1 0 2 0 1 0 2 ...

output:

58903

result:

ok 1 number(s): "58903"

Test #19:

score: 0
Accepted
time: 108ms
memory: 38784kb

input:

250000 257500
0 1 1 1 2 0 2 0 2 0 0 0 0 0 1 1 0 0 1 1 2 0 1 2 2 1 0 0 0 2 0 2 1 1 0 0 2 0 2 2 0 2 2 2 2 2 2 1 2 2 2 0 2 0 0 2 1 0 0 1 0 0 0 1 0 2 2 1 2 2 1 2 1 0 0 0 2 2 0 1 0 2 1 2 1 1 2 0 0 0 1 0 2 1 1 1 2 2 2 1 1 1 1 0 1 0 2 1 2 1 2 1 1 2 2 0 1 2 0 2 1 0 0 0 2 0 1 2 2 0 0 2 2 1 0 2 1 1 0 0 2 0 2 ...

output:

246014

result:

ok 1 number(s): "246014"

Test #20:

score: 0
Accepted
time: 119ms
memory: 38804kb

input:

250000 260000
2 2 0 1 2 0 1 2 2 1 0 2 2 2 0 0 0 0 0 0 1 2 0 2 1 0 2 1 1 2 2 1 2 1 0 1 1 1 0 0 2 2 1 1 0 1 0 0 1 2 2 1 1 2 2 1 0 2 1 0 1 1 2 1 1 0 1 2 0 0 0 0 1 2 0 2 2 2 1 2 2 0 1 1 0 2 1 0 1 1 2 1 1 1 1 1 0 1 0 2 1 0 0 0 1 2 2 1 0 2 0 0 1 0 2 2 2 2 0 2 1 1 0 2 0 1 1 1 1 2 2 0 1 0 2 2 1 0 2 2 0 2 1 ...

output:

9416

result:

ok 1 number(s): "9416"

Test #21:

score: 0
Accepted
time: 133ms
memory: 40412kb

input:

250000 300000
1 0 2 1 1 2 0 2 1 1 2 2 2 0 2 0 0 1 1 1 2 2 1 2 0 1 1 2 1 2 1 0 0 0 1 0 0 2 1 1 1 2 2 1 2 1 0 0 1 2 1 0 0 2 2 2 0 1 2 2 0 1 1 2 0 1 2 0 2 1 1 0 1 2 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0 0 0 0 0 0 1 1 0 0 1 1 2 1 1 0 0 0 1 2 2 2 1 2 1 0 2 2 2 1 0 0 1 2 1 1 0 0 1 1 1 2 1 1 0 0 1 1 1 1 2 1 1 1 ...

output:

237910

result:

ok 1 number(s): "237910"

Test #22:

score: 0
Accepted
time: 155ms
memory: 43012kb

input:

250000 350000
2 0 2 1 2 0 0 1 0 1 0 2 0 0 0 0 2 2 0 0 0 1 2 1 1 2 0 2 2 0 0 2 0 0 1 1 1 0 0 2 1 2 0 0 0 1 0 1 2 1 1 1 0 2 2 0 0 0 2 0 0 0 2 2 1 2 0 0 1 2 1 2 2 0 1 2 2 2 1 1 2 0 1 2 2 1 2 1 0 0 2 2 1 2 0 2 0 1 1 0 0 0 1 2 2 1 0 2 1 1 2 2 2 1 0 0 0 0 1 0 2 1 2 1 2 0 0 0 2 0 2 0 0 2 1 1 0 1 2 2 0 1 2 ...

output:

28823

result:

ok 1 number(s): "28823"

Test #23:

score: 0
Accepted
time: 172ms
memory: 43096kb

input:

250000 400000
2 1 2 0 0 0 2 1 0 1 2 2 2 0 0 0 0 0 0 1 0 0 1 0 1 1 2 2 2 1 2 2 2 0 2 0 0 0 0 1 0 2 2 1 1 0 0 0 0 1 0 0 1 2 0 2 2 2 1 2 0 2 2 1 2 0 2 2 0 0 1 1 2 0 1 2 1 1 0 1 1 2 0 0 2 1 2 0 0 2 2 0 0 0 0 2 1 0 1 1 2 0 0 0 2 0 1 0 0 0 2 2 0 1 0 1 0 0 2 0 0 1 1 1 2 0 0 1 0 2 2 2 0 0 0 0 0 2 2 0 0 2 1 ...

output:

247227

result:

ok 1 number(s): "247227"

Test #24:

score: 0
Accepted
time: 171ms
memory: 44092kb

input:

250000 450000
1 2 0 0 0 1 0 1 1 2 2 0 0 2 1 1 0 0 0 2 1 2 1 1 0 1 2 0 1 2 0 0 2 1 0 0 0 1 0 0 0 0 2 1 2 2 1 2 0 2 1 2 2 2 1 1 2 0 2 2 1 0 1 0 2 2 1 0 2 2 0 0 0 1 2 2 1 2 1 1 1 2 1 1 0 0 2 1 2 2 0 0 0 0 2 0 2 2 0 2 0 2 1 1 1 0 1 0 1 0 2 0 1 1 0 1 2 1 2 2 1 2 1 2 1 2 2 1 0 1 1 2 1 2 0 1 1 1 1 2 0 0 1 ...

output:

67494

result:

ok 1 number(s): "67494"

Test #25:

score: 0
Accepted
time: 179ms
memory: 45520kb

input:

250000 500000
1 1 0 1 0 1 0 1 2 2 0 0 0 1 0 2 2 2 0 0 2 0 2 1 1 0 2 0 0 0 2 2 2 1 1 0 1 2 0 2 2 1 0 2 2 0 0 2 2 0 0 0 1 0 2 0 1 2 0 1 1 1 1 0 2 0 0 1 1 1 1 2 0 2 2 1 1 1 2 1 2 0 0 0 1 0 0 2 0 2 2 0 0 1 0 1 1 0 1 1 1 0 2 1 1 1 0 0 1 2 1 0 0 0 0 1 0 0 0 0 2 1 2 2 1 1 1 1 0 1 0 0 2 1 1 2 2 0 2 2 0 2 2 ...

output:

118087

result:

ok 1 number(s): "118087"

Test #26:

score: 0
Accepted
time: 196ms
memory: 47372kb

input:

300000 500000
0 2 1 0 1 2 0 0 2 2 0 0 2 0 2 1 2 2 2 2 2 2 2 2 1 1 0 2 1 0 2 1 1 0 0 0 1 2 0 2 0 1 1 2 0 1 1 0 1 1 0 1 0 2 2 1 2 0 0 0 2 0 2 0 1 1 2 2 0 1 2 1 2 2 0 2 1 1 2 2 2 0 2 2 2 1 0 0 0 2 1 0 1 0 2 0 1 1 2 1 1 0 0 2 1 2 2 2 0 2 2 2 1 1 1 2 2 0 0 2 0 2 1 1 2 2 2 1 2 0 1 0 1 2 1 0 2 1 2 2 2 2 1 ...

output:

277224

result:

ok 1 number(s): "277224"

Test #27:

score: 0
Accepted
time: 198ms
memory: 47964kb

input:

400000 500000
0 1 0 1 0 0 0 1 0 1 0 2 1 0 2 2 1 1 1 0 2 1 2 2 1 0 0 1 2 1 1 2 0 2 0 0 1 2 1 1 0 2 2 0 2 0 0 2 0 1 1 2 1 2 2 0 1 2 0 1 0 2 2 1 0 0 0 1 1 2 0 0 2 2 0 0 0 2 0 0 2 1 2 1 1 1 1 2 2 0 1 2 0 2 0 2 1 2 1 2 1 0 0 0 0 0 2 2 1 2 2 0 0 2 1 2 1 2 2 0 1 2 0 1 2 1 2 2 0 2 2 2 2 0 2 2 0 2 1 0 2 1 2 ...

output:

208631

result:

ok 1 number(s): "208631"

Test #28:

score: 0
Accepted
time: 206ms
memory: 50096kb

input:

500000 500000
1 2 0 0 2 1 0 2 1 1 2 1 0 1 1 2 2 2 1 0 1 1 2 2 0 1 1 0 0 0 2 1 2 1 1 1 1 0 2 1 2 2 1 1 2 2 0 0 1 2 1 2 2 2 0 2 0 0 2 2 2 2 0 2 2 2 2 2 0 2 2 0 2 0 0 2 1 0 0 0 0 2 2 1 2 2 1 2 2 0 0 1 2 1 1 2 1 1 2 2 0 1 2 1 1 0 2 1 2 1 1 2 1 1 0 1 2 1 2 1 0 0 0 2 1 2 2 0 0 1 1 0 1 1 1 0 1 1 1 2 2 1 2 ...

output:

302244

result:

ok 1 number(s): "302244"

Test #29:

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

input:

1 0
0

output:

1

result:

ok 1 number(s): "1"

Test #30:

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

input:

100 99
2 2 2 2 1 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 0 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
5 99
5 81
5 10
5 98
5 100
5 51
5 30
5 43
5 54
5 46
5 67
5 8
5 17
5 63
5 82
5 35
5 44
5 2
5 94...

output:

56

result:

ok 1 number(s): "56"

Test #31:

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

input:

1000 999
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:

984

result:

ok 1 number(s): "984"

Test #32:

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

input:

10000 9999
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:

4988

result:

ok 1 number(s): "4988"

Test #33:

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

input:

100000 99999
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:

47630

result:

ok 1 number(s): "47630"

Test #34:

score: 0
Accepted
time: 142ms
memory: 54304kb

input:

500000 499999
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:

137055

result:

ok 1 number(s): "137055"

Test #35:

score: 0
Accepted
time: 143ms
memory: 54084kb

input:

500000 499999
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:

46758

result:

ok 1 number(s): "46758"

Test #36:

score: 0
Accepted
time: 149ms
memory: 54184kb

input:

500000 499999
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:

322304

result:

ok 1 number(s): "322304"

Test #37:

score: 0
Accepted
time: 87ms
memory: 37592kb

input:

250000 249999
1 1 0 2 2 1 0 0 1 2 2 0 2 0 2 0 1 0 2 2 2 0 2 0 2 2 0 2 2 0 2 0 0 1 1 1 0 2 1 2 2 2 1 0 0 2 0 1 2 0 2 2 0 2 0 1 0 2 1 0 0 2 0 1 2 2 0 2 1 0 1 2 2 2 1 0 1 0 0 2 1 0 2 2 0 2 2 1 1 0 2 2 1 1 0 2 1 1 2 0 0 2 0 2 0 0 1 1 0 0 2 0 1 1 1 2 2 0 0 1 1 0 2 2 0 2 0 2 2 1 1 0 0 2 2 1 0 2 2 0 2 2 0 ...

output:

180263

result:

ok 1 number(s): "180263"

Test #38:

score: 0
Accepted
time: 81ms
memory: 37824kb

input:

250000 250000
2 1 0 1 2 2 0 0 1 1 1 1 2 0 0 2 1 0 1 0 0 1 2 2 1 0 1 0 1 1 2 0 0 2 2 0 0 0 2 2 1 0 0 0 0 2 0 0 0 1 0 1 2 2 2 1 2 1 2 1 1 2 0 1 0 2 0 2 0 0 2 2 0 2 2 1 2 1 1 1 2 0 2 1 0 0 2 1 2 2 1 1 0 2 0 2 0 1 1 2 2 0 0 2 0 0 2 0 1 1 2 2 1 2 2 2 2 1 0 2 1 0 2 1 2 0 2 2 2 0 1 1 0 0 1 1 2 0 2 0 0 2 2 ...

output:

22413

result:

ok 1 number(s): "22413"

Test #39:

score: 0
Accepted
time: 135ms
memory: 44700kb

input:

250000 400000
1 0 2 0 1 2 0 0 1 2 2 2 1 2 0 0 1 2 0 0 2 0 0 1 1 2 2 2 1 2 0 2 1 0 0 0 1 2 0 0 0 2 0 0 0 1 1 1 1 2 1 2 2 1 0 1 2 0 0 1 2 2 2 0 2 1 0 0 1 2 2 2 2 0 0 1 2 2 0 2 0 2 1 2 1 2 2 0 1 1 0 0 2 2 2 2 0 2 2 1 0 2 0 2 1 2 2 2 1 2 0 1 1 2 2 2 0 2 0 1 2 0 2 2 0 1 2 0 0 0 2 0 0 2 1 2 1 1 1 0 2 2 2 ...

output:

101763

result:

ok 1 number(s): "101763"

Test #40:

score: 0
Accepted
time: 163ms
memory: 47040kb

input:

250000 500000
2 1 0 1 1 1 0 1 1 2 2 0 2 2 1 0 1 1 1 1 0 1 2 2 2 1 1 0 0 0 2 0 0 1 2 0 1 2 0 0 0 0 2 2 1 2 1 2 1 1 1 0 1 0 0 1 0 1 0 0 2 2 2 2 2 2 1 1 0 0 0 0 1 0 1 1 0 0 2 0 0 0 1 1 0 0 0 1 1 2 2 2 0 2 0 2 1 0 0 1 2 1 1 0 0 2 1 2 1 2 0 0 1 0 1 1 1 0 1 0 1 0 0 1 1 1 0 2 0 2 1 0 2 1 2 0 1 1 0 2 1 0 0 ...

output:

164561

result:

ok 1 number(s): "164561"

Test #41:

score: 0
Accepted
time: 248ms
memory: 46720kb

input:

500000 499999
2 2 1 0 1 2 0 2 1 0 2 2 2 0 2 1 0 0 1 0 0 0 2 0 0 2 0 1 0 1 0 1 0 1 2 1 0 0 2 0 2 2 2 0 0 2 2 1 2 0 1 0 2 1 0 0 1 2 2 0 2 2 0 0 1 1 1 1 2 2 2 2 2 1 2 1 0 0 1 0 1 2 0 1 1 0 0 0 1 2 1 2 2 0 0 1 2 1 0 0 2 1 0 0 0 2 1 0 1 2 0 0 1 1 1 0 0 1 1 0 2 2 1 1 2 0 0 1 1 2 2 1 1 0 1 2 1 1 2 2 0 0 2 ...

output:

448614

result:

ok 1 number(s): "448614"

Test #42:

score: 0
Accepted
time: 208ms
memory: 46604kb

input:

500000 500000
0 2 2 1 0 2 2 1 2 0 2 2 1 2 2 0 1 2 1 1 0 0 2 0 1 2 1 0 2 1 0 0 1 0 0 2 2 1 2 0 2 2 2 0 0 1 2 2 0 0 1 1 2 0 2 2 1 1 0 2 2 2 2 2 2 2 1 0 2 2 2 0 1 2 2 1 0 1 0 1 0 1 1 0 0 0 2 1 0 2 1 0 1 1 0 2 0 1 0 1 1 1 1 1 2 1 1 1 2 0 2 2 1 2 2 0 2 2 2 0 2 1 0 0 1 0 1 1 2 0 1 2 1 1 2 0 1 1 0 2 1 2 2 ...

output:

41021

result:

ok 1 number(s): "41021"

Test #43:

score: 0
Accepted
time: 74ms
memory: 37228kb

input:

250000 249999
0 2 1 1 2 1 2 2 0 2 1 0 0 0 1 2 1 1 1 0 0 0 0 0 1 2 0 2 2 0 1 0 0 2 2 1 1 1 2 1 1 2 2 2 0 0 1 2 2 2 0 1 1 0 1 2 1 0 0 1 1 2 1 2 0 2 2 2 0 1 2 1 0 1 2 1 0 2 2 2 0 1 1 1 1 1 2 1 2 1 1 1 2 2 1 0 0 1 2 2 0 2 2 0 1 1 2 2 1 0 0 0 2 0 0 0 2 0 2 2 1 0 1 0 2 0 0 1 2 1 0 2 1 0 2 0 1 2 2 0 0 2 1 ...

output:

149349

result:

ok 1 number(s): "149349"

Test #44:

score: 0
Accepted
time: 65ms
memory: 40480kb

input:

250000 250000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 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 0 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 1 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 1 2 2 2 2 2 ...

output:

96370

result:

ok 1 number(s): "96370"

Test #45:

score: 0
Accepted
time: 104ms
memory: 43760kb

input:

250000 400000
2 2 2 2 0 2 2 0 0 0 2 2 0 2 2 2 2 2 0 1 2 2 1 2 0 1 2 2 1 1 2 0 2 1 2 2 2 1 0 2 0 2 2 2 0 1 2 2 0 2 2 0 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 0 1 2 1 2 2 1 2 2 2 1 2 0 0 1 1 2 0 2 1 2 0 2 1 2 2 2 2 2 0 1 0 2 2 1 0 2 1 0 2 1 2 2 1 2 2 2 0 2 1 2 2 0 0 0 2 1 2 1 2 0 2 1 2 2 ...

output:

66931

result:

ok 1 number(s): "66931"

Test #46:

score: 0
Accepted
time: 145ms
memory: 46696kb

input:

250000 500000
1 2 2 2 2 0 2 1 0 2 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 0 1 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 ...

output:

185953

result:

ok 1 number(s): "185953"

Test #47:

score: 0
Accepted
time: 240ms
memory: 47320kb

input:

500000 499999
2 2 2 0 0 2 0 0 2 2 2 0 2 2 0 2 2 1 1 2 1 0 1 1 1 1 0 2 2 1 1 0 0 2 1 0 1 0 1 1 1 0 0 1 0 2 2 0 0 1 2 0 2 2 1 0 0 0 0 2 2 0 0 0 2 0 0 1 0 0 0 2 0 2 0 2 0 0 1 0 0 0 2 1 0 1 0 1 1 2 0 0 2 1 0 1 0 2 0 1 0 1 2 1 1 0 1 0 1 2 1 2 0 0 0 1 0 0 0 2 1 0 2 0 1 0 2 0 2 0 2 1 2 0 1 0 0 1 2 0 0 1 1 ...

output:

265842

result:

ok 1 number(s): "265842"

Test #48:

score: 0
Accepted
time: 136ms
memory: 53392kb

input:

500000 500000
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 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 0 2 0 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:

263153

result:

ok 1 number(s): "263153"