Doubt in AtCoder Editorial

Revision en1, by vatsalseth33, 2020-10-15 23:54:58

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?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English vatsalseth33 2020-10-15 23:54:58 557 Initial revision (published)