CF - Wizard's Tour

Author: Benjamin Qi

Official Editorial (brief)

In other words, we want to pair up as many edges as possible such that the edges in each pair share a vertex.

Obviously the task can be solved independently for each component.

The answer is always for a single connected component.

Tree Case

Solution

General Case

Solution

Give Us Feedback on CF - Wizard's Tour!

Join the Discussion!

Feel free to voice your thoughts in the comments section.