Triangular Queries
You are given N lattice points (Xi, Yi), i = 1, 2, ..., N on a 2D Coordinate System. You have to process Q queries, each query will be given as the form "x y d". Let ABC be the triangle having vertices at A(x+d, y), B(x, y) and C(x, y+d). For each query, you have to find how many of the given lattice points lie inside or on the boundary of the triangle ABC. Input The first line of the input co
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