cf/mirror

Maximum Adjacent Pairs

CF
1615G3300· legendary gm3s512 MB⌨ stdin/stdout

Examples

Sample 1of 7
Input
4
1 1 0 2
Output
1 1 2 2
Sample 2of 7
Input
5
0 0 0 0 0
Output
3 1 1 3 3
Sample 3of 7
Input
5
1 2 3 4 5
Output
1 2 3 4 5
Sample 4of 7
Input
6
1 0 0 0 0 1
Output
1 2 3 3 1 1
Sample 5of 7
Input
3
3 0 2
Output
3 2 2
Sample 6of 7
Input
5
1 0 2 0 1
Output
1 2 2 1 1
Sample 7of 7
Input
7
1 0 2 3 1 0 2
Output
1 2 2 3 1 1 2
1615G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)