Sunday, March 24, 2013

project euler problem 056

Powerful digit sum

I wrote something like BigInteger for problems involve number greater than 2^64; This is the first time that I used this class. There is probably quite a few problems in PE problems between 50--100 require BigInteger. 

 I do not prefer to use it since the performance of my biginteger class is poor. But for this problem, it is OK. I checker all combinations, and the time cost is only 0.1s. 

update: 09/16/2017
I wrote a python script to avoid using bigInteger class. It is just several lines to solve this problem.

No comments:

Post a Comment