MEXimum

Limits 1s, 512 MB

Let’s get straight to the point. You are given a tree. In the tree, each node uuu has a number aua_uau assigned to it. The **score** of a node uuu is defined as the MEXMEXMEX of all the numbers on the simple path from 111 to uuu.

This is a companion discussion topic for the original entry at https://toph.co/p/meximum