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

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

Hi community, recently I found this contest and i am curious to know how to solve problem BOXING BOOKS.My first tought was a dp solution

dp[i][j] = min(dp[i][j], dp[r][j — 1] + cost(i,j))

Obviusly, this solution will give TLE, My question is Can this problem be solve using Divide and Conquer? There is a simplest solution?

Thanks.

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

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Your solution doesn't give TLE, the time limit is 5 seconds. But if you want to do it in n * k time, it may be possible by using some convex hull trick reasoning