Don’t know what’s wrong in this, getting error
Getting Error using map
- change line 16 to dp.insert(make_pair(n,max(dp[n],rem+maxgold(n/2,dp)+maxgold(n/3,dp)+maxgold(n/4,dp))));
- after line 16, write return dp[n];
https://ide.codingblocks.com/s/230018 , still getting wrong ans on 2 test cases, don’t getting it.
@Akshay123
do following change, code will work
- line 25 -> ll curr=( maxgold(n/2,dp)+maxgold(n/3,dp)+maxgold(n/4,dp));
- line 29 -> ll curmax=max(n,curr);
Thanks man, finally getting AC!!