Editorial for Back to School '24 P3 - Tournament
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Build a segment tree over the array
To find the answer for all possible positions to insert the missing student, two update operations can be used to swap the missing student with their neighbor to the right, querying
Time Complexity:
Comments