← All problemsSign in

Playing With Digits

###Problem description. Alice wants to play a game with Bob but Alice is solving a problem of Mathematics. She tells Bob to help her to solve the problem so that they can go to play. The problem is such that there is an array $A$ and there are $q$ queries of type: $L1$ $R1$ $L2$ $R2$ $C$ Let, $P$=sum(A[i]) for i=$L1$ to $R1$ (inclusive) $Q$=sum(A[i]) for i=$L2$ to $R2$ (inclusive) $C$ re

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