Closest points queries
Consider a set of points in 2D which is initially empty. You need to process queries which insert and remove points from it. After each query, you should also print the square of the distance between two closest points in the set. If there are fewer than 2 points in the set, print 0 instead. It is guaranteed that all the queries are valid — there will be no query of adding a point that is alrea
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start