QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#375571#7604. Find the VertexLoverInTimeAC ✓40ms6300kbC++17527b2024-04-03 13:18:412024-04-03 13:18:42

详细

Test #1:

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

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: 1ms
memory: 3832kb

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: 3836kb

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: 1ms
memory: 3872kb

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: 1ms
memory: 5876kb

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: 5844kb

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: 1ms
memory: 3736kb

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: 1ms
memory: 5888kb

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: 1ms
memory: 5828kb

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: 1ms
memory: 3800kb

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: 1ms
memory: 3864kb

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: 0ms
memory: 3912kb

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: 1ms
memory: 3896kb

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: 2ms
memory: 3792kb

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: 5ms
memory: 5148kb

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: 10ms
memory: 5072kb

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: 16ms
memory: 4968kb

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: 13ms
memory: 5068kb

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: 13ms
memory: 5092kb

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: 15ms
memory: 5856kb

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: 15ms
memory: 5020kb

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: 17ms
memory: 5140kb

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: 27ms
memory: 4960kb

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: 31ms
memory: 5024kb

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: 28ms
memory: 5088kb

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: 30ms
memory: 5212kb

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: 27ms
memory: 5696kb

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: 31ms
memory: 6184kb

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: 1ms
memory: 3800kb

input:

1 0
0

output:

1 

result:

ok 1 number(s): "1"

Test #30:

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

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: 1ms
memory: 3752kb

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: 1ms
memory: 3764kb

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: 5ms
memory: 4276kb

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: 33ms
memory: 6224kb

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: 31ms
memory: 6180kb

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: 25ms
memory: 6260kb

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: 14ms
memory: 6036kb

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: 13ms
memory: 6024kb

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: 22ms
memory: 5016kb

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: 30ms
memory: 6128kb

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: 40ms
memory: 6220kb

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: 31ms
memory: 6124kb

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: 10ms
memory: 5008kb

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: 14ms
memory: 5016kb

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: 19ms
memory: 5076kb

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: 26ms
memory: 4964kb

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: 34ms
memory: 6300kb

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: 28ms
memory: 6184kb

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"