Doubt in AtCoder Editorial

Правка en1, от 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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский vatsalseth33 2020-10-15 23:54:58 557 Initial revision (published)