cf/mirror

Array

CF
2209B900· newbie1.5s256 MB⌨ stdin/stdout
#greedy

Examples

Sample 1of 1multi-test • hover to link
Input
6
1
1092
2
105 -105
5
1 2 93 84 2
7
2 9 38 4 7 1 6
10
1 9 20 9 829 3 87 1 283 7
11
9 18 29817 283 3 3928 5726 1942 1000000000 -1000000000 19
Output
0
1 0
4 2 2 1 0
5 4 4 2 2 1 0
8 4 4 3 5 3 2 2 1 0
8 7 7 4 5 3 3 2 2 1 0
2209B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)