cf/mirror

Rae Taylor and Trees (easy version)

CF
2171D1400· specialist3s256 MB⌨ stdin/stdout

Examples

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