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.
This problem was really hard. The algorithm must O(rlogr) to pass all test cases. For me it involved counting coprimes in given range using inclusion/exclusion principle and generating totient values via sieve.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #184: Triangles containing the origin.
You are viewing a single comment's thread. Return to all comments →
This problem was really hard. The algorithm must O(rlogr) to pass all test cases. For me it involved counting coprimes in given range using inclusion/exclusion principle and generating totient values via sieve.