Editorial for Back To School '19: A Circular Game
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Subtask 1
For the first subtask, we can try every possible spinner position and calculate the minimum time required to set all
Time Complexity:
Subtask 2
For the second subtask, one can observe that checking the current
Time Complexity:
Subtask 3
For the third and final subtask, we can calculate the total time efficiently by reusing the previously calculated values. Going back to the two groups method, we can maintain the groups using a two-pointer approach after sorting the items. We can then calculate the new time by adding and subtracting the change in group sizes as we loop through all
Time Complexity:
Comments