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

Автор AP_222, история, 6 лет назад, По-английски

I was trying to understand open ande closed interval trick in dp problem 626F through this article, http://codeforces.com/blog/entry/47764 Please have a look at it problem 626F. I don't understand what it means to place ai in it's own group, in comment it was mentioned, opening a new interval and closing it so it's imbalance should be zero then why we're taking val = k+j.(ai — ai-1) as new state.

"val = k + j(ai - ai-1)" "We place the current number ai in its own group : Then, dp[i][j][val] +  = v."

And i was unable to understand this too, why j.v We place the current number ai in one of the open groups, but not close it : Then, dp[i][j][val] +  = j·v (we choose one of the open groups to add ai.)

can anybody help me please. It's important.

can anybody explain what we're doing here, in detail if possible.

Полный текст и комментарии »

Теги #dp
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится