cf/mirror

Tree Operations

CF
2035F2500· grandmaster4s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
2 1
1 2
1 2
3 2
2 1 3
2 1
3 2
4 1
1 1 0 1
1 2
2 3
1 4
12 6
14 4 5 6 12 9 5 11 6 2 1 12
3 9
10 6
6 12
4 3
3 1
5 11
9 7
5 6
1 8
2 8
5 1
1 1
0
Output
3
6
5
145
0
2035F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…