Wednesday, July 17, 2013

project euler problem 245

Coresilience

 A very difficult problem. 

 I lost my old code. I only left a several-lines comment in my computer. It says my old code runs for 80 seconds to get the answer. 

This time, I want to see if I can make it faster by myself. I found that I cannot solve it!  I believe it can be solved only by brute force. After some time's thought, and with the help of my comment. The problem is solved in one minute. My method is almost all brute force, but I found some property from the equation that can reduce the search space.

I read the discussion, I found there is a much better way to solve the problem. I implemented the new method. The problem is solved in 5 seconds.

 

No comments:

Post a Comment