You are viewing a single comment's thread. Return to all comments →
my method 1)varing a from 1 to n 2)varying b from 1 to a 3)c=p-a-b 4)checking if a^2+b^2=c^2 5)correspondingly selecting the value of p
but this method is quite lengthy,timeout for case#2 and above.
Suggest a efficient method.
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #39: Integer right triangles
You are viewing a single comment's thread. Return to all comments →
my method 1)varing a from 1 to n 2)varying b from 1 to a 3)c=p-a-b 4)checking if a^2+b^2=c^2 5)correspondingly selecting the value of p
but this method is quite lengthy,timeout for case#2 and above.
Suggest a efficient method.