cf/mirror

Turtle and Paths on a Tree

CF
1981F3000· legendary gm4s1024 MB⌨ stdin/stdout

Examples

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