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

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

Hey guys, I've been trying various approaches for this problem which appeared in this contest (ended). I submitted many solutions with different DP states but even my best solution gives me TLE on half of the test cases. My DP states are 'n' and the current number under consideration for the sequence, say 'i'. For each dp[n][i], I consider all cases, from the inclusion of no 'i' to the max number of times that 'i' can be included in the sequence.

I request you to share your approach(es) to this problem, please.

My submission — link

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

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

Check the following constructive DP approach for solving the problem.

link