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.
I have a method that seems to correctly calculate g(n) for n > 63 very quickly (g(64) -> g(1000) in 0.005 sec) but for some reason from g(1) to g(63) its mostly incorrect.
However, it seems like not even this method can work within the required time constraint for tests other than #0 and #1. I believe the numbers are not much bigger than g(150), but you must calculate lots of them, since q can get up to 10^5.
I also implemented a semi-brute force method with DP, but I can only get through test #0.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #254: Sums of Digit Factorials
You are viewing a single comment's thread. Return to all comments →
I have a method that seems to correctly calculate g(n) for n > 63 very quickly (g(64) -> g(1000) in 0.005 sec) but for some reason from g(1) to g(63) its mostly incorrect.
However, it seems like not even this method can work within the required time constraint for tests other than #0 and #1. I believe the numbers are not much bigger than g(150), but you must calculate lots of them, since q can get up to 10^5.
I also implemented a semi-brute force method with DP, but I can only get through test #0.