JasonMendoza2008's blog

By JasonMendoza2008, 4 months ago, In English

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.

  • Vote: I like it
  • +10
  • Vote: I do not like it

»
4 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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.