Treasure Hunt
CodeChefOpen on judge ↗
Two friends Ron and Harry went to take part in a game called treasure hunt. There are N levels in the game. In each level ‘i’, Ci numbers of coins of the same value are hidden. Ron is happy if he has strictly more coins than Harry. However, Harry is happy only if the difference between their number of coins is not more than 1. They agree to help each other by collecting the coins in such a way tha
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