Wrong answer at atcoder

in the code few testcases are giving wrong answer

my code, which is obviously the one been told in the tutorial but here it is https://ide.codingblocks.com/s/245540

@sshreya2912
I don’t think you have shared the correct code. can you please check it once confirm?

this one it is https://ide.codingblocks.com/s/245811 im sorry about the last one idk how it happened

@sshreya2912
in option1 and option2, you have wrote dp[n-1] and dp[n-2] which should be dp[i-1] and dp[i-2] respectively.
Rest is correct.
Please also remember to mark this doubt as resolved after getting AC.

i was so stupid thankyou so much!

1 Like