What is wrong in my code i am getting TLE in it(question link-https://www.codechef.com/SEPT19B/problems/FIBEASY

In the constrains it is given that N can as large as 10^18. And in one second computer can run at most 10^7 operations. Therefore it will give TLE as it exceeds the time constraint.

Search and understand Pisano period of fibonacci series for a better approach.

Also you can go through my solution
https://www.codechef.com/viewsolution/26443778

2 Likes

thanks i got it