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.
I'm using F# and BigIntegers for this problem. Initially got a TLE on test case 4 and 5. Locally for n=10^4 my solution would run for about 8 seconds. So to get my solution accepted, I precalculated everything and used that. But that's not very satisfying.
Did anybody solve this problem in a .NET language or Java, without precalculation? Did I miss any cleverness to avoid using BigIntegers and huge numbers? Any hint would be appreciated. Thanks!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #57: Square root convergents
You are viewing a single comment's thread. Return to all comments →
I'm using F# and BigIntegers for this problem. Initially got a TLE on test case 4 and 5. Locally for n=10^4 my solution would run for about 8 seconds. So to get my solution accepted, I precalculated everything and used that. But that's not very satisfying. Did anybody solve this problem in a .NET language or Java, without precalculation? Did I miss any cleverness to avoid using BigIntegers and huge numbers? Any hint would be appreciated. Thanks!