QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#285674#7942. $K$ Subsequencesucup-team646#AC ✓23ms4956kbC++232.0kb2023-12-16 21:25:322023-12-16 21:25:32

詳細信息

Test #1:

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

input:

5
3 2
1 -1 1
4 2
-1 1 1 -1
7 3
1 1 1 1 1 1 1
10 3
1 1 1 1 -1 -1 1 1 1 1
12 4
1 1 1 1 -1 -1 -1 -1 1 1 1 1

output:

1 1 2
1 1 2 1
1 2 3 1 2 3 1
1 2 3 1 2 3 2 3 2 3
1 2 3 4 1 2 3 4 1 2 3 4

result:

ok Correct (5 test cases)

Test #2:

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

input:

18434
10 1
-1 1 1 -1 -1 1 -1 -1 1 1
10 2
-1 -1 -1 1 1 -1 1 1 1 1
10 2
1 -1 -1 -1 -1 1 1 -1 1 1
10 7
1 1 -1 1 -1 1 1 -1 -1 1
9 1
-1 1 -1 1 1 -1 1 -1 1
8 1
-1 -1 -1 -1 1 1 -1 -1
10 3
-1 -1 -1 1 1 1 1 -1 -1 -1
9 1
1 -1 -1 1 -1 -1 -1 -1 -1
10 10
-1 1 1 1 1 1 1 1 1 1
10 4
-1 1 -1 1 -1 1 1 -1 1 1
9 3
1 1 ...

output:

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

result:

ok Correct (18434 test cases)

Test #3:

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

input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 13 13 14 15 14 15 16 16 16 16 16 16 16 16 17 18 17 18 19 20 19 21 20 22 21 23 22 24 23 25 24 26 25 26 27 27 28 29 30 31 28 32 33 34 29 30 35 31 32 36 37 33 34 35 36 38 37 38 39 39 40 41 40 42 43 41 42 44 43 44 45 45 46 46 47...

result:

ok Correct (1 test case)

Test #5:

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

input:

1
199996 136
-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 -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 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 1 1 1 1 1 1 -1 -1 -1 1 1 1 1 1...

output:

1 1 2 3 4 5 1 6 2 3 7 4 8 9 5 6 10 11 12 13 14 7 15 8 9 16 10 17 18 11 12 19 13 14 20 15 21 22 23 24 25 26 16 17 18 19 27 20 21 22 23 24 25 26 27 28 29 30 28 31 32 33 29 34 35 36 37 38 30 31 39 32 40 33 34 41 42 43 44 35 45 36 37 38 39 46 47 40 41 42 43 48 44 49 50 51 52 53 45 46 54 55 56 57 58 59 6...

result:

ok Correct (1 test case)

Test #6:

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

input:

1
199998 86240
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 -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 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 -1 -1 1 -1 -1 -1 -1 1 1 -1...

output:

1 2 1 3 4 5 6 7 8 2 9 10 3 11 4 5 6 12 13 14 15 16 17 18 7 19 20 21 22 23 8 24 9 10 11 12 13 14 15 16 25 17 18 26 19 20 21 22 27 28 23 24 25 29 30 26 27 31 32 28 33 29 34 30 35 31 36 37 38 39 40 32 41 33 42 34 43 35 36 44 45 46 37 38 39 40 41 42 47 48 49 50 43 44 45 51 52 46 47 53 48 54 55 56 49 50 ...

result:

ok Correct (1 test case)

Test #7:

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

input:

1
199998 196586
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 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 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 1 -1 -1 -1 -1...

output:

1 1 2 2 2 2 3 3 4 4 5 5 5 5 6 6 6 6 7 7 7 7 7 7 8 9 10 8 9 10 11 11 12 12 12 13 12 14 13 15 14 16 17 18 15 16 17 18 19 19 20 20 20 20 21 21 21 22 22 22 23 24 25 26 22 27 28 23 29 30 31 32 24 25 26 33 34 27 28 35 36 29 30 31 37 32 33 34 38 35 36 37 39 38 39 40 40 41 41 42 42 42 43 43 44 45 44 45 46 4...

result:

ok Correct (1 test case)

Test #8:

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

input:

2
53064 32664
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 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 -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 -1 1 -1 1 1 -1 -1 1 1 1 ...

output:

1 2 3 1 4 5 6 2 7 8 9 3 4 10 5 6 11 12 13 7 8 14 9 15 16 17 10 11 12 18 13 14 15 16 17 19 18 20 19 20 21 21 22 22 23 22 23 24 24 24 25 26 24 27 25 26 27 28 28 29 30 31 28 32 33 29 34 30 35 31 32 36 33 37 34 35 38 36 39 40 37 41 42 38 39 40 43 44 45 46 47 41 48 49 42 50 51 43 44 45 46 52 53 47 48 49 ...

result:

ok Correct (2 test cases)

Test #9:

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

input:

2
86135 2
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 -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 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 1 1 1 1 1 -1 1 -1 1 -1 1 -1 1...

output:

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

result:

ok Correct (2 test cases)

Test #10:

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

input:

2
114819 248
-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 -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 -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 -1 -1 -1 1 -...

output:

1 1 1 1 1 1 1 2 2 3 3 3 4 5 4 6 5 6 7 7 8 8 8 9 9 10 10 11 11 11 11 11 11 11 11 11 12 12 13 13 13 14 15 16 17 14 15 16 17 18 19 20 21 22 18 19 23 20 21 22 24 23 24 25 25 25 26 26 27 26 27 28 28 29 28 29 30 30 30 31 31 32 32 32 33 32 33 34 34 34 35 36 34 35 36 37 37 37 38 38 38 39 40 38 39 40 41 41 4...

result:

ok Correct (2 test cases)

Test #11:

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

input:

2
51745 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 -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 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 -1 -1 -1 -1 1 1 -1 1 1 -1 1 1 ...

output:

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 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 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 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 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (2 test cases)

Test #12:

score: 0
Accepted
time: 17ms
memory: 4172kb

input:

2
190655 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 -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 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 1 1 1 1 1 1 -1 -1 ...

output:

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 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 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 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 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (2 test cases)

Test #13:

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

input:

3
509 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 -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 -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 1 1 1 1 -1 1 -1 1 -...

output:

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

result:

ok Correct (3 test cases)

Test #14:

score: 0
Accepted
time: 14ms
memory: 3956kb

input:

4
25729 81
-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 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 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 1 -1 1 1 -1 -1 1 -1 1 ...

output:

1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 3 3 4 4 4 4 5 5 5 6 7 8 6 7 9 10 8 11 9 10 12 11 12 13 13 13 14 14 15 15 15 15 15 15 16 15 16 17 17 18 19 20 21 22 23 18 24 25 26 19 20 21 27 28 29 30 31 32 33 22 23 24 25 34 26 27 28 29 35 30 36 31 37 38 32 39 33 40 41 34 35 42 43 44 45 46 47 36 37 48 49 38 50 51 39 40...

result:

ok Correct (4 test cases)

Test #15:

score: 0
Accepted
time: 17ms
memory: 4012kb

input:

5
7824 2
-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 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 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 1 -1 1 -1 1 -1 1 1 1 -1 -1...

output:

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

result:

ok Correct (5 test cases)

Test #16:

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

input:

6
7149 4795
-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 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 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 -1 -1 1 1 1 1 1 1 -1 -1 -1...

output:

1 1 1 1 2 2 3 2 4 5 6 7 3 8 4 5 6 7 8 9 9 9 9 10 10 10 11 11 11 12 12 12 12 13 14 15 12 16 13 17 18 19 14 15 20 16 21 22 23 17 24 25 26 27 18 28 19 29 20 30 21 31 32 33 34 35 36 37 38 22 39 23 24 25 26 27 28 29 30 31 40 41 32 42 43 33 34 35 36 44 45 46 37 47 48 38 49 39 50 40 51 52 41 53 42 43 44 54...

result:

ok Correct (6 test cases)

Test #17:

score: 0
Accepted
time: 13ms
memory: 3988kb

input:

7
16819 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 -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 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 -1 -1 1 1 1 -1 1 -1 -1 1 -1 -1 1 ...

output:

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 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 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 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 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (7 test cases)

Test #18:

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

input:

8
29021 106
-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 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 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 -1 -1 -1 1 -1 -1 -1 1 -1 -1 ...

output:

1 1 1 1 1 1 2 2 3 3 4 5 6 4 5 7 8 9 10 11 6 7 12 13 8 9 10 14 15 11 12 13 14 15 16 16 17 16 18 19 20 17 18 19 21 22 23 24 25 26 27 28 20 29 21 30 22 23 31 24 32 25 33 26 34 35 27 36 37 28 38 29 30 31 39 40 41 42 32 33 34 35 43 36 44 37 38 45 46 39 40 41 47 42 48 49 43 50 51 52 44 53 45 54 55 46 47 4...

result:

ok Correct (8 test cases)

Test #19:

score: 0
Accepted
time: 14ms
memory: 3824kb

input:

9
37136 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 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 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 1 -1 -1 1 -1 -1 1 1 1 1 -1 1 -1 ...

output:

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 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 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 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 1 1 1 1 1 1 1 1 1 1 ...

result:

ok Correct (9 test cases)

Test #20:

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

input:

10
5543 1596
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 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 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 1 1 -1 -1 -1 -1 1 ...

output:

1 2 3 1 4 5 6 2 3 4 7 8 5 6 7 9 8 10 9 10 11 11 12 12 12 12 12 12 12 13 12 14 13 14 15 15 16 15 17 16 17 18 18 18 19 20 19 20 21 22 23 24 25 21 22 26 27 23 28 29 24 30 25 31 32 26 27 28 33 29 34 30 31 35 32 33 34 36 35 36 37 37 38 38 38 39 39 40 40 40 41 41 41 41 41 41 42 43 44 41 42 43 44 45 46 47 ...

result:

ok Correct (10 test cases)

Test #21:

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

input:

100
2336 29
-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 -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 -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 -1 1 1 1 1 1 -1 1 -1 -1 -1 ...

output:

1 1 1 1 1 2 3 2 3 4 4 4 5 5 6 7 8 9 10 5 6 11 12 7 13 8 9 10 14 11 12 15 16 17 18 13 19 20 14 21 15 22 23 24 16 17 18 19 20 25 26 21 27 28 22 23 29 1 1 24 2 3 2 3 4 4 25 26 5 5 27 28 6 7 8 9 10 6 7 11 8 9 10 11 29 12 12 12 13 14 15 16 17 13 18 19 20 14 21 22 23 15 1 1 24 16 2 3 4 25 26 2 5 3 4 5 27 ...

result:

ok Correct (100 test cases)

Test #22:

score: 0
Accepted
time: 15ms
memory: 3608kb

input:

101
92 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 -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 1 -1 1 1 -1 1 1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 -1 -1
2647 2314
-1 1 -1 -1 1 1 1 -1 1 1 1 1 -1 1 -1 -1 1 -1 -1...

output:

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 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 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 2 3 4 2 5 6 7 8 3 9 4 5 10 6 7 8 11 9 10 11 12 13 12 13 14 14 15 15 15 15 15 16 15 16 17 17 17 18 19 17 18 2...

result:

ok Correct (101 test cases)

Test #23:

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

input:

102
8381 7064
-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 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 -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 -1 -1 1 1 1 -1 1 -1 -1 -1...

output:

1 1 1 2 1 2 3 3 4 5 6 7 8 4 5 9 6 10 7 11 12 13 8 9 10 14 11 15 16 17 18 12 13 14 15 19 20 21 16 17 22 23 18 24 19 25 20 21 26 22 23 27 24 28 29 25 26 30 31 32 27 28 29 33 34 35 36 37 38 30 31 39 32 40 33 34 35 36 41 42 37 43 44 38 39 45 40 41 46 42 43 44 47 45 46 48 47 49 50 48 49 51 52 53 54 50 51...

result:

ok Correct (102 test cases)

Test #24:

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

input:

103
1976 404
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 -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 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 -1 -1 -1 -1 -1 1 1 1 1 -1 -...

output:

1 1 2 2 2 3 3 3 3 4 5 3 6 7 4 5 8 6 9 7 10 8 9 11 12 13 14 10 11 15 16 17 12 18 13 14 19 15 20 16 21 17 22 23 24 25 26 27 18 19 28 20 21 29 30 31 32 33 34 22 23 35 36 37 38 24 25 26 39 27 40 28 41 42 43 44 29 45 30 31 32 33 46 34 35 47 36 37 38 48 39 40 41 49 42 50 51 43 52 53 44 54 45 55 46 47 48 4...

result:

ok Correct (103 test cases)

Test #25:

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

input:

104
3135 3
1 -1 -1 -1 -1 -1 -1 -1 -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5 2 7 2 8 6 7 8 9 10 1 1 3 3 3 4 4 5 5 5 5 2 2 2 6 7 8 6 9 7 10 1 3 4 1 5 2 6 2 7 3 4 5 1 1 2 3 2 4 3 5 1 2 1 3 2 1 1 3 2 1 1 2 3 1 1 2 2 3 4 5 1 1 6 7 2 3 4 2 5 1 1 3 6 7 4 2 1 3 4 1 2 3 3 3 4 5 6 7...

result:

ok Correct (105 test cases)

Test #27:

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

input:

1000
1284 8
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 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 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 -1 1 -1 1 -1 -1 -1 -1 1 1 1 1 -1...

output:

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

result:

ok Correct (1000 test cases)

Test #28:

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

input:

1001
151 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 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 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 2 3 4 5 5 5 6 1 5 1 5 2 2 6 1 1 6 3 3 5 5 2 1 6 3 1 5 1 1 2 2 2 3 5 6 2 2 1 1 3 3 4 5 4 5 6 6 6 2 2 2 1 3 4 5 1 3 ...

result:

ok Correct (1002 test cases)

Test #30:

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

input:

1003
95 16
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 -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 -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
526 3
1 -1 -1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

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

result:

ok Correct (1003 test cases)

Test #31:

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

input:

1004
322 257
-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 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 -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 -1 1 -1 1 1 1 1 -1 -1 1 -1 -1 1 -1...

output:

1 1 2 3 4 5 6 1 2 7 8 3 4 5 9 6 7 10 8 11 9 10 11 12 13 14 15 16 17 12 18 19 13 20 14 21 15 22 23 16 24 17 25 26 27 18 28 29 19 20 30 21 31 32 22 23 24 33 25 34 26 35 27 36 37 38 28 39 40 41 29 30 42 43 31 32 33 44 45 46 47 48 49 50 34 35 51 52 53 54 55 56 57 58 36 37 38 59 39 60 40 61 62 41 42 43 6...

result:

ok Correct (1004 test cases)

Test #32:

score: 0
Accepted
time: 15ms
memory: 3564kb

input:

1005
508 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 -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 -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 1 -1 -1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 1 1 1 -1 -1 1 1 1 ...

output:

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

result:

ok Correct (1005 test cases)

Test #33:

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

input:

9995
9 7
-1 1 -1 -1 -1 1 -1 -1 1
1 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1
1 1 1 1 1 2 2 3 3 3 4 3 1 2 1 3 2 1 1 2 2 1 1 2 2 1 1 2 1 1 2 3 4 1 1 1 2
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 1
1 1 2 3 4 5 6 7 1 2 3 4 5 8
1 2 1 3 1 1 1 ...

result:

ok Correct (9996 test cases)

Test #35:

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

input:

9997
15 9
-1 1 1 -1 1 1 -1 1 -1 1 1 1 1 1 1
1 1
1
37 20
-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 1 -1
64 2
-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 1 -1 -1 -1 1 1 -1 -1 1 1 -1 -1 1 -1 -1 -1 -1 1 1 -1 -1 -...

output:

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

result:

ok Correct (9997 test cases)

Test #36:

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

input:

9998
28 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
12 2
-1 -1 -1 1 -1 -1 1 -1 1 1 -1 1
8 6
-1 1 1 -1 1 1 1 1
3 1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 1 2 2 1 2 1 1 1 2 2 2 1 2 1 1 1 1 1 2 1 1 2 2 1 1 1 1 2 2 1 1 1 2 1 2 1 1 1 1 1 2 1 1 1 1 ...

result:

ok Correct (9999 test cases)

Test #38:

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

input:

10000
15 3
-1 1 -1 1 -1 -1 1 -1 1 -1 1 -1 -1 -1 1
3 3
-1 1 1
34 2
-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
3 2
1 1 -1
25 2
-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
11 1
1 -1 -1 -1 -1 -1 1 -1 -1 -1 1
29 2
-1 -1 -1 1 -1 1 -1 -1 -1 -1...

output:

1 1 1 2 2 3 3 3 1 1 2 2 3 3 3
1 1 2
1 1 1 1 1 1 2 2 1 1 1 1 1 2 2 2 2 1 1 1 2 2 1 1 1 2 1 1 2 1 1 1 2 1
1 2 1
1 1 1 2 1 2 2 2 2 2 1 1 2 1 1 2 2 2 1 2 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 2 2 1 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 2 1 2 1 1 1
1 1 2 2
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 ...

result:

ok Correct (10000 test cases)

Extra Test:

score: 0
Extra Test Passed