We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My algorithm is O(log N). And actually it goes into memory error before timeout because I precompute some Fibonacci numbers. It happens after N = 2^(2^20), so after 10^315652.
But you have to do it up to 10^5 times, thats why I precompute some Fibonacci numbers.
It takes 4s in python on the last test, so 10^5 Ns with each N up to 10^18.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #137: Fibonacci golden nuggets
You are viewing a single comment's thread. Return to all comments →
My algorithm is O(log N). And actually it goes into memory error before timeout because I precompute some Fibonacci numbers. It happens after N = 2^(2^20), so after 10^315652.
But you have to do it up to 10^5 times, thats why I precompute some Fibonacci numbers.
It takes 4s in python on the last test, so 10^5 Ns with each N up to 10^18.