| 
  • 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
 

PE028

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

Project Euler Problem #28

 

I coded this up as a speed challenge to myself. I had 15 minutes and wanted to see how many problems I could get done.  I also solved #30.

 

I did not build the spiral.  I DID NOT BUILD THE SPIRAL!!!  Look for a pattern in the numbers in the corners.  Each layer had 4 of them, and each set of corners is 2 farther from each other than the layer before.  ie 3 to 5 is 2, 13 to 17 is 4, two more than the layer before.

 

Ran freakin fast.  Linux reported 0.000 second runtime.

PE028_c

 


Return to list of solutions

Comments (0)

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