Can anyone give an idea how to solve?

Правка en3, от Deepression, 2024-10-23 21:18:14

You are given an array of size N and must construct a deque by pushing each element one by one, either to the front or the back. You can push a total of K elements to the back and M elements to the front, with the constraint that M + K = N . Your goal is to determine the maximum number of index pairs (i, j) such that 2 *{deque}[i] > {deque}[j] and i < j. Constraints on N is 1e6.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Deepression 2024-10-23 21:18:14 26 Tiny change: ' and i < j' -> ' and i < j. Constraints on N is 1e6.'
en2 Английский Deepression 2024-10-23 21:16:43 0 (published)
en1 Английский Deepression 2024-10-23 21:16:25 393 Initial revision (saved to drafts)