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.
Because exponentiation to power b=10^100000 would require at least 300000 modular multiplications. And just reading b into binary representation might require 100000^2 multiplications, if you do not use BigInteger in Java or some internal very long integers say in Python.
In what language did you solve the problem, and what are the timings?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Power of large numbers
You are viewing a single comment's thread. Return to all comments →
Because exponentiation to power b=10^100000 would require at least 300000 modular multiplications. And just reading b into binary representation might require 100000^2 multiplications, if you do not use BigInteger in Java or some internal very long integers say in Python.
In what language did you solve the problem, and what are the timings?