← All problemsSign in

Sereja and Ballons

CodeChefRating 2265Open on judge ↗

Sereja has n boxes with balloons. Boxes are numbered with integers from 1 to n. The first box contains a[1] balloons, the second- a[2] balloons and so on. Also Sereja wrote down m pairs of the number (l[1], r[1]), (l[2], r[2]), ..., (l[m], r[m]) on a piece of paper. Now Sereja decided to play and began to burst the balloons in the boxes. At every step Sereja bursts one balloon from some box and wa

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