Competitive-Programming-and-Contests-VP-Solution

The repository that contains all solutions made for the course Competitive Programming and Contests by the University of Pisa

View the Project on GitHub

Tree and Queries

Solved Solution Time :clock11:
:heavy_check_mark: Mo’s Algorithm 155 ms

Solution or Solution discussion

The solution with mo’s algorithm require a remapping the tree inside a array where we can run Mo’s algorithm to get the solution at this problem. The solution is divided in the following steps: