This problem: https://mirror.codeforces.com/gym/106160/problem/B has an editorial (it's a pdf attached) and they claim: 
But to me the relationship should be:
$$$f(i, x) = cost(i, x) + min_{y ≤ x} f(i-1, y)$$$ where $$$cost(i, x)$$$ is either 0, 1, or 2.
Definitely have no idea where the max could come from.
Would love to have someone double check if what I'm claiming is true or if I'm just dumb and misreading the editorial.








You're right, the other solutions are already sufficient, so that's probably why we as jury missed the wrong formula on the last slide.
Thanks for the confirmation (and thanks for the problemset it was really fun to go through the problems)