Choosing Subtree is Fun

2020 VietMX 0

There is a tree consisting of n vertices. The vertices are numbered from 1 to n. Let’s define the length of an interval [l, r] as the value r - l + 1. The score of a subtree […]