Editorial for An Animal Contest 1 P6 - Alpaca Distancing
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Subtask 1
This subtask was intended to reward brute force solutions.
Time Complexity:
Subtask 2
Let
Time Complexity:
Subtask 3
There are many approaches hereafter. A binary indexed tree (BIT) for prefix maximum queries will be used in this solution.
To optimize the transition, we add the
Time Complexity:
Subtask 4
For full marks, coordinate compression of the values used in the BIT is required.
Time Complexity:
Comments