Thanks a lot @shraeyas
Shouldnât the answers be 10??
@kodeerder Since f (x) = f (x-1) + f (x+1) so that =ăf (x+1) = f (x) - f (x-1), use the concept of generating fibonacci numbers to solve it for f (x+1)
Exactly, it should be 10
Sorry my bad
@anno Mark it as accepted answer and no problem codechef discuss is meant to help⌠PS i too faced problem while solving this the 1st time.
In line number 27 you can use x <<n than manually multiplying using while loopâŚ
Tried, but it still gives TLE
No it is passing with 0.04 seconds.
Canât see your solution on spoj. You need to give ideone or pastebin link.
Oh ,sorryâŚI forgot
I willâŚlet me see to it.
What changes did you make?
Just added the input. I wasnât giving any input.
@mathecodician using vector for R1 and R2 is slowing you down. Use arrays instead and you will get AC. Also your INF*INF
is actually overflowing which is not a problem here, but it may be an issue is some other problem so be careful about that.
Youâre welcome