← All problemsSign in

Range Queries and Copies

CSESRange QueriesOpen on judge ↗

Your task is to maintain a list of arrays which initially has a single array. You have to process the following types of queries: - Set the value a in array k to x. - Calculate the sum of values in range [a,b] in array k. - Create a copy of array k and add it to the end of the list. Input The first input line has two integers n and q: the array size and the number of queries. The next line h

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