Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×

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

Автор Petr, история, 6 лет назад, По-английски
  • Проголосовать: нравится
  • +99
  • Проголосовать: не нравится

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

Huh, as I read this, my solution to E seems to have zero things common with editorial as well. I solve $$$O(nk)$$$ problems where each element is $$$0$$$ or $$$1$$$ with some probability (depending on its position). For binary strings original problem can be solved while keeping two variables — what is the optimal cost if I have an interval opened and what if I don't have it opened. Using that insight, for each prefix I count number of sequences that will lead me to each state of dp (and there are $$$O(n^2)$$$ states of this dp for each prefix, so $$$O(n^3)$$$ in total, so my solution works in $$$O(n^4k)$$$.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится -53 Проголосовать: не нравится

sir recommend some good resources for cp