cf/mirror

Lisa's Sequences

CF
1773L3500· legendary gm5s1024 MB⌨ stdin/stdout
#dp

Examples

Sample 1of 9
Input
5 3
1 2 3 4 5
Output
2
1 0 3 0 5
Sample 2of 9
Input
6 3
1 1 1 1 1 1
Output
3
1 100000 0 1 0 1
Sample 3of 9
Input
6 4
1 1 4 4 1 1
Output
1
1 1 4 0 1 1
Sample 4of 9
Input
6 4
4 4 4 2 2 2
Output
2
4 4 0 2 0 2
Sample 5of 9
Input
6 4
4 4 4 3 4 4
Output
1
4 4 100000 3 4 4
Sample 6of 9
Input
8 4
2 1 1 3 3 1 1 2
Output
2
2 1 1 3 0 1 0 2
Sample 7of 9
Input
10 4
1 1 1 2 2 1 1 2 2 1
Output
2
1 1 100000 2 2 100000 1 2 2 1
Sample 8of 9
Input
7 5
5 4 4 3 4 4 4
Output
0
5 4 4 3 4 4 4
Sample 9of 9
Input
10 10
1 1 1 1 1 1 1 1 1 1
Output
1
1 1 1 1 1 1 1 1 0 1
1773L.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)