Help
CodeChefOpen on judge ↗
Gagan was given a one dimensional integer array A of length N. Mayank challange him to maintain the array under Q queries of the following four types. Assume 1-based indexing and where M = 1000000000 + 7. Query 1 : 1 x y This is a report query which needs to find the sum of the values in A from x to y,(inclusive A[x] and A[y]). Query 2 : 2 v x y This implies adding v to array A to all the indi
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.
Sign in to chat with the tutor and save your progress.
Sign in to start