I've been trying to solve the DP section of CSES problemset and I noticed that usually the problems give TLE verdict if we're solving the problems using recursive DP. Am I doing something wrong, or the time limit is actually really strict?
Here is my solution for the problem Book Shop. Is there any way I can make my recursive solution faster?
Spoiler