cf/mirror

Destruction of a Tree

CF
963B2000· candidate master1s256 MB⌨ stdin/stdout

Examples

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