Getting Error using map

Don’t know what’s wrong in this, getting error

@Akshay123

  1. 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))));
  2. 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

  1. line 25 -> ll curr=( maxgold(n/2,dp)+maxgold(n/3,dp)+maxgold(n/4,dp));
  2. line 29 -> ll curmax=max(n,curr);

Thanks man, finally getting AC!!