Suyash and Queries
CodeChefOpen on judge ↗
Suyash was provided with an array of length N initially filled with 0’s. Later he was given Q queries each with three parameters L, R & W where W is the weight that has to be added to each element of the array in the index range L to R (index is 1 based). He was asked to execute all the queries and return the final array. Since Suyash was busy in some other task he called for your help Input
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