Little Girl and Problem on Trees
276E2100· master2s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
3 61 21 30 3 1 20 2 3 10 1 5 21 11 21 3
Output
996
Sample 2of 2
Input
6 111 22 55 41 61 30 3 1 30 3 4 50 2 1 40 1 5 50 4 6 21 11 21 31 41 51 6
Output
111711161711
58%
276E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…