Balanced Numbers
This is an interesting problem. My old code use very cumbersome sum and counting algorithms. But since we just need a number modulo 3^15, we can do it more efficiently. I do not understand why we are asked to give T(47), T(10000) is more challenging. I wrote poor quality code for T(47). But after I tried to solve T(10000), the algorithm need to be carefully thought over.
My algorithm can compute T(10000) in about 5 seconds. After I checked some of the code in the discussion. I can speed up my code by a factor of 2.x . I played with the code for two days for better performance.
No comments:
Post a Comment