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

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

Problem — Link
Editorial — Link
Should'nt the solution be dp[i] = sum(dp[j]*dp[i-j]) for j=3 to i-3 where i is the required sum for the iteration ? My reasoning is that when ever we use a sequence of sum j (whose count is dp[j]) then we can append another sequence of sum i-j to it to make total sum i. The editorial says to find dp[i] we just find sum(dp[j]) for j=i-3 to 0. Can someone explain how?

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