The Game Of Weights
CodeChefOpen on judge ↗
Aditya is playing a game with Dhivya. There is a weighing scale with 2 pans. There are also N weights numbered from 1 to N in a queue, owned by Dhivya. Aditya initially has no weights with him. Aditya processes the weights owned by Dhivya one-by-one. At any point of time, he weighs the weights that he owns against the next weight in queue. For example, if after 2 iterations, Aditya somehow owned
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