| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

PE030

Page history last edited by Kenneth Finnegan 15 years, 7 months ago

Project Euler Problem #30

 

Seperate each digit using %10 to find ones digit, then divide by 10 to shift to next digit.  For some reason pow() from math.h wasn't working for me, so I just wrote a function to find the 5th power for me.

 

Not being smart, it takes about 5m30 seconds to solve.  Once I got into the forums, someone had a proof that there are no solutions past a smaller number, which brought the runtime down to 0.028 seconds.

 

PE030_c

 


Return to list of solutions

Comments (0)

You don't have permission to comment on this page.