cses.fi/proble... In this problem we see how memoization and dynamic programming can reduce the complexity of some recursive functions from exponential to linear.
In this problem, dp[i] depends on the 6 previous values: dp[i-1], .... , dp[i-6]. and we need 5 additions to sum them up. In general, if you have n values, u need n-1 additions to sum them up.
You are the best tutor in the world
best channel for practicing cses problem
Thank you!
agreed
Thanks for such a great visualization!
glad you liked it!
Explanation was gold! Thank you
thank you so much for making these solutions
you are very welcome!
Thanks !
you are very welcome!
I have found your channel very helpful.
thank you very much!
amazing video
Thank you so much!
Nice thx u:3
Can you explain what you mean by 5 additions?
In this problem, dp[i] depends on the 6 previous values: dp[i-1], .... , dp[i-6]. and we need 5 additions to sum them up. In general, if you have n values, u need n-1 additions to sum them up.
@@neatlystructured thank you!
Sorry, but i have question. Why you use mod in code? Why we need it? Thanks for tut
because the answer might be too large for long long or int to store
For 10, we consider 9,8,7,6,5 and 4.. why don't we consider the rest?
because the dice can be 1, 2, 3, 4, 5 or 6. it cant be greater than that
eggrice
yes please