← All problemsSign in

Disparity check

There is an array A of N integers with Q queries. There are 2 types of queries: Type 1: It contains two integers: x y This means increase a[x] by the given y i.e. a[x] becomes a[x]+y. Type 2: It contains three integers: L R parity If parity=1, then you have to output the sum of all the odd elements in the range L to R (L and R inclusive). If parity=0, then you have to output the sum of all

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