Editorial for IOI '18 P3 - Werewolf
Submitting an official solution before solving the problem yourself is a bannable offence.
Subtask 1
You choose a vertex
For each choice of
The time complexity of this solution is
Subtask 2
Determine the set of vertices you can visit from
Then check whether these two sets intersect.
The time complexity of this solution is
Subtask 3
Let
Subtask 4
We can construct a rooted tree so that
Comments