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.
It's possible to fiddle with lists of factors to keep numbers small, and that would be Number Theory.
But it's also possible to do what I did and use some implementation of Big Integers to actually simply multiply those numbers out, find their GCD, modulo it to 1000000007 and print it out.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Huge GCD
You are viewing a single comment's thread. Return to all comments →
It's possible to fiddle with lists of factors to keep numbers small, and that would be Number Theory.
But it's also possible to do what I did and use some implementation of Big Integers to actually simply multiply those numbers out, find their GCD, modulo it to 1000000007 and print it out.