Destruction of a Tree
963B2000· candidate master1s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
50 1 2 1 2
Output
YES12354
Sample 2of 2
Input
40 1 2 3
Output
NO
58%
963B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…
50 1 2 1 2
YES12354
40 1 2 3
NO