cf/mirror

Remove the Grail Tree

CF
2193H2400· grandmaster3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
3
1 2 4
1 2
2 3
4
3 4 2 1
1 2
2 3
3 4
6
9 6 5 1 7 4
1 2
2 3
2 4
3 5
4 6
5
2 1 1 1 2
2 1
3 2
2 4
5 4
5
1 5 3 7 9
1 2
2 3
3 4
4 5
Output
NO
YES
2 3 1 4
NO
YES
1 5 2 3 4
YES
2 4 1 5 3
2193H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…