A question on Educational Codeforces Round 120 problem D

Revision en1, by my_lie_in_april, 2022-01-01 09:24:31

Link to the problem: https://codeforces.me/problemset/problem/1622/D

In this problem's editorial, they mention that there is an O(N) solution that work with this problem, and now I'm curious to learn it. Can anyone help me ?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English my_lie_in_april 2022-01-01 09:24:31 336 Initial revision (published)