[Coco] Project Euler and the Coco

Mark McDougall msmcdoug at iinet.net.au
Sat Nov 15 18:20:46 EST 2008


Arthur Flexser wrote:

> I'd do it as two successive FOR/NEXT loops, the first taking A from 2 to 250
> with B ranging from (501-A) to (999-A)/2, and the second taking A from 251 to
> 333 with B ranging from (A+1) to (999-A)/2.  (Come to think of it, the upper
> bound for A should be 332 rather than 333, since if A were 333, then the
> minimums for B and C would be 334 and 335, which adds to 1002.)
> 
> A more satisfying comparison than how many iterations are needed to find the
> solution would be how many iterations are necessary to search the parameter
> space to completion, in order to verify that there is only one solution.

My code as posted finds the solution in 10,174 iterations, with 28,054 
iterations required to search the solution space.

Your optimisation requires 9826 iterations, with 20,584 in total!

John's OP - 66,309/110,556

Regards,

-- 
|              Mark McDougall                | "Electrical Engineers do it
|  <http://members.iinet.net.au/~msmcdoug>   |   with less resistance!"



More information about the Coco mailing list