CLOPPAIR - Closest Point Pair
You are given N points on a plane and your task is to find a pair of points with the smallest euclidean distance between them.
All points will be unique and there is only one pair with the smallest distance.
First line of input will contain N (2<=N<=50000) and then N lines follow each line contains two integers giving the X and Y coordinate of the point. Absolute value of X,Y will be atmost 10^6.
Output 3 numbers a b c, where a,b (a<b) are the indexes (0 based) of the point pair in the input and c is the distance between them. Round c to 6 decimal digits.
See samples for more clarification.
0 1 1.000000Input:
0 4 1.414214
omg guys. I managed to get past test case 12. So what happened was that my solution was correct, but because I used cout with setprecision(7), it displayed the wrong answer for some reason. So if you want to pass this challenge, use printf
Remember to print the smaller index first
can anyone provide me fully accepted code for this question ,, i am trying it from two days but always getting wa near test case 12 ....
Use long long int: ) , using double caused me 4 WA on test case 12 ;(
12th case WA is probably because of the (a<b) condition
Don't use long long...May get WA becoz of that.Use double.Comparisons are not that strict !! Attention to (a<b) in output .( WA becoz of that -_-) .
Did anyone identify what are we getting WA on 12th case even after using long long int
Getting WA did n't understand why this is happening ? Only after the 12th case it shows wrong answer?Last edit: 2015-07-02 21:37:44
getting WA12 even after using long long int can any1 pls find the mistake
Use long long int :)