Editorial for DMOPC '18 Contest 5 P5 - A Hat Problem
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Each person has two choices, so there are
Time Complexity:
For the second subtask, let
The sum
Time Complexity:
For the final subtask, we analyze the
Note that each sum can be split into a component that depends only on
Time Complexity:
Comments