Saturday, June 1, 2013

project euler problem 195

Inscribed circles of triangles with one angle of 60 degrees

I like this problem. When I first tried to solve this problem. I found some quick formula for the problem and solved the problem in 1 second. This time, I revised the code a little bit, checking gcd as the last criteria, my code's run time reduced to 0.47 second.

After I read the discussion thread, I recommend everyone read lomont's post on the second page. It is a brief but interesting tutorial about Eisenstein integers. 

No comments:

Post a Comment