cf/mirror

Fix a Tree

CF
698B1700· expert2s256 MB⌨ stdin/stdout

Examples

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