Magic Sticks
CodeChefOpen on judge ↗
Mark,a magician, has a great interest in arranging sticks. He use to play with various sticks of different lengths. He put n sticks on the table along one axis, going from left to right. Every stick stands perpendicular to that axis so that the axis passes through the center of its base. The i-th stick has the coordinate xi and the length li. Now Mark wants to learn for every stick, how many stick
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