Help in a Dp problem

Revision en1, by practicener, 2020-10-21 20:58:44

I am referring to problem- https://mirror.codeforces.com/problemset/problem/1067/A. I did refer to the editorial for this problem and well, it is really hard to understand. I do get the overall sketch of the solution but there are a few ambiguities in the language of the editorial- https://mirror.codeforces.com/blog/entry/62688. I still got no idea what "flag" state is doing in dp. Perhaps the editorial writer wanted to say(i am using the same notation as used in the editorial) "flag=0 when the a[prefix-1]<=a[prefix] " or something like that. Can anyone help me figure out what exactly the editorial wants to say? I will be really thankful. I know it is kinda ..............frustrating to go through a problem statement and then the editorial to try and understand what I am trying to ask. But both the problem statement and editorial for the problem won't take too long to read. Thank you

Tags dp, editorial

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English practicener 2020-10-21 20:58:44 915 Initial revision (published)