Sort 3 Discussions, By:
Please Login in order to post a comment
what's ans for 2500?
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.
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