Tuesday, August 19, 2014

Closest Points


Problem Link : http://www.codechef.com/problems/CLOSEST

Although my solution for this problem is not good,i would like to share it with you.

Idea: Given N points as 3D for BTPD help center and Q points for banks.The problem want at least one correct solution fer accept :).In my solution,i calculate for first bank.Take input for N points in an array.Then take input for Q banks.Calculate distance from each help center to first bank.Find out the minimum one.Save the number of that help center that is closest to first bank.
Then show the same result for Q banks :)
My solution : http://pastebin.com/bUe1YDNS

No comments:

Post a Comment