We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.

# Project Euler #91: Right triangles with integer coordinates

# Project Euler #91: Right triangles with integer coordinates

+ 1 comment what's ans for 2500?

+ 0 comments The key for this problem is to find out different kinds of triangle that can be formed in this setting. You won't want to iterate every pair of points to check whether a right triangle can be formed or not. Instead, you get a right triangle and check whether it is within the upper bound.

Certain triangles are easy to get. Those with two side along x-axis and y-axis respectively. Those with one side along either axis where the axis itself is not hypotenuse. With some further observation you can get the rest based on the above triangles with rotation and

`gcd`

.

+ 1 comment I dont understand this question. In the given example why is the triangle formed by (0,1) , (1,0) , (1,1) not present in the list.

No more comments

Sort 3 Discussions, By:

Please Login in order to post a comment