QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#274205#7604. Find the VertexGuanYunchangAC ✓138ms40248kbC++201.3kb2023-12-03 12:52:182023-12-03 12:52:20

详细

Test #1:

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

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: 3ms
memory: 18368kb

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

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

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

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: 3ms
memory: 17656kb

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: 3ms
memory: 18804kb

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

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: 3ms
memory: 17980kb

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

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

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

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: 3ms
memory: 18536kb

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: 3ms
memory: 19992kb

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: 59ms
memory: 29664kb

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: 65ms
memory: 28904kb

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: 60ms
memory: 30456kb

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: 62ms
memory: 30388kb

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: 49ms
memory: 29040kb

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: 67ms
memory: 30764kb

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: 75ms
memory: 30772kb

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: 80ms
memory: 33040kb

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: 80ms
memory: 33360kb

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: 117ms
memory: 33476kb

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: 128ms
memory: 35816kb

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: 135ms
memory: 35600kb

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: 131ms
memory: 37304kb

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: 138ms
memory: 39820kb

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: 4ms
memory: 18708kb

input:

1 0
0

output:

1

result:

ok 1 number(s): "1"

Test #30:

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

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

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: 4ms
memory: 17896kb

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

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: 98ms
memory: 40248kb

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: 100ms
memory: 40144kb

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: 105ms
memory: 40080kb

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: 63ms
memory: 29144kb

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: 66ms
memory: 27940kb

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: 104ms
memory: 32532kb

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: 125ms
memory: 34684kb

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: 136ms
memory: 36756kb

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: 134ms
memory: 36772kb

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: 67ms
memory: 28268kb

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: 44ms
memory: 28516kb

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: 83ms
memory: 31444kb

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: 121ms
memory: 33256kb

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: 135ms
memory: 36984kb

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: 101ms
memory: 39900kb

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"