Блог пользователя JasonMendoza2008

Автор JasonMendoza2008, 4 месяца назад, По-английски

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.

  • Проголосовать: нравится
  • +10
  • Проголосовать: не нравится

»
4 месяца назад, скрыть # |
 
Проголосовать: нравится +1 Проголосовать: не нравится

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.