Timelimit in one testcase,how do i optimize
@aryanv https://ide.codingblocks.com/s/158184
Try submitting this. I don’t think so that there is more scope to optimize.
@aryanv Change line 10 to dp[i]=max(i,dp[(lli)(i/2)]+dp[(lli)(i/3)]+dp[(lli)(i/4)]); and then check
n/2,n/3 and n/4, these can also be float values so typecast it to long long int
@pratyush63 ok it works, but shouldnt division of long long int by 2,3,4 produce another long long int?
@aryanv Yes…but no problem…you can see that the loop variable i is also of long long int type…