← All problemsSign in

Harry Potter and the Goblet of Fire

CodeChefRating 2782Open on judge ↗

"If you want to know what a man’s like, take a good look at how he treats his inferiors, not his equals." There are N wizards in Hogwarts with each wizard at level Ai. Harry is analyzing behaviour of different wizards. Sirius maps behaviour of one wizard using a Generous function defined as: Sirius asks Harry several queries. Each query contains L, R and P. Harry has to find Total Generosity fo

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start