Ultra's Brain dump What would UltraL0rd do?

18May/100

Project Euler : Problem 9 Solved

With Problem 9 of Project Euler I got a bit lazy :(
I'll be the first to admit that instead of researching this one properly I just did a mean old brute force attack.

My first attempt took over 4secs to calculate the answer.
I then cleaned up the loops and made it more efficient and got it down to 1297ms.
Then after looking at examples of how other people did it I first bashed my head on the keyboard at the simplicity of it all, and then recoded my final version...
0ms!

The Problem is as follows :

"There exists exactly one Pythagorean triplet for which a + b + c = 1000.

Find the product abc."

Tips :

  1. Don't try brute force this.. Remember how Pythagorean triplets work

Project Euler Stats :

Total Research Time : 0 Days
Total Coding Time : 15mins
Total Code Execution Time : 1297ms (after complete redo : 0ms)

Posted by UltraL0rd

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.