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.
No "deep" knowledge required, and no hardcoded data sets required. For L=10^5, r=1.5, there are about 90000 triples that satify the abc conditions. You should be able to compute these in < 1s (mine does it in about 100ms). The forum on project euler has some good ideas to help with that. The key to handling large number of test-cases is to avoid recomputing triples altogether, and to avoid having to search through a list of 90k-100k triples to find the ones that satify a given (r,L).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #127: abc-hits
You are viewing a single comment's thread. Return to all comments →
No "deep" knowledge required, and no hardcoded data sets required. For L=10^5, r=1.5, there are about 90000 triples that satify the abc conditions. You should be able to compute these in < 1s (mine does it in about 100ms). The forum on project euler has some good ideas to help with that. The key to handling large number of test-cases is to avoid recomputing triples altogether, and to avoid having to search through a list of 90k-100k triples to find the ones that satify a given (r,L).