← All problemsSign in

Vivek and Sum Queries

Vivek made a new problem for Gaurav. He gave him an array A1,A2,...,AN of N numbers (1-based indexing). Now he gave him Q number of queries to execute on these numbers. Each queries consisting of two integers a and b. For each queries, Vivek wants him to find the sum of all all the numbers exept from a to b (both inclusive) i.e. A1+...+Aa-1 + Ab+1+...+AN Input - I"The first line of the input c

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