← All problemsSign in

Rick and Reactive Vaccine

Rick once decided to prepare some vaccines in his lab. There are $N$ chemicals kept on his shelf linearly from position 1 to $N$. Reactivity of the $i^{th}$ chemical is denoted by an integer $A_i$. He wants to make $Q$ vaccines. A vaccine will be made using the chemicals in the continuous range $A_L$, $A_{L + 1}$, .., $A_R$ (1-base indexing). The process of making vaccines is a bit tricky.

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