Up and Down the Tree
1065F2500· grandmaster3s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
7 11 1 3 3 4 4
Output
4
Sample 2of 2
Input
8 21 1 2 3 4 5 5
Output
2
58%
1065F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…
7 11 1 3 3 4 4
4
8 21 1 2 3 4 5 5
2