even after applying memoization in the question i getting
time limit excedded error.please check it sir as soon as possible
Time limit exceeding error even after applying memeoization
Please provide your code in Coding Blocks IDE
@ashishranjanraju1234
Since you are not providing your code, let me give you a hint for the recursive and memoised approach.
int rec(int n,int m){
if(dp[n]!=-1)
return dp[n];
if(n<m)
return 1;
if(n==m)
return 2;
return dp[n] = (rec(n-1,m)%mod+rec(n-m,m)%mod)%mod;
}
Actually,it was just my fault in doing modulo operation
Not all test cases passed…
ok, please mark it as solved if your doubt is solved, else provide me the code so I can debug it. @ashishranjanraju1234