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.
Letting there is the relation and hence the problem yields to dynamic programming where a buffer can be used to update . However it seems that even this is not fast enough so I think there is another trick that is missing. Any hints?
Tricks I already used
raising to a power by breaking up the exponent into powers of 2 and repeated squaring
for prime
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #190: Maximising a weighted product
You are viewing a single comment's thread. Return to all comments →
It seems the crux of the problem is calculating .
Letting there is the relation and hence the problem yields to dynamic programming where a buffer can be used to update . However it seems that even this is not fast enough so I think there is another trick that is missing. Any hints?
Tricks I already used