Set 105Question 16

Tanvir's Live Range Query System

Very hardWritten in CMust finish in 5 seconds

Tanvir is building a dashboard for a hospital's records desk that must support both live value updates and fast range-sum queries.

What your program reads

Line1: N Q. Line2: N integers. Next Q lines: update or query.

What your program prints

Answer for each query op.

Limits

1 ≤ N,Q ≤ 10^5

Example input

5 2
1 2 3 4 5
Q 1 5
Q 2 4

Expected output

15
9
main.c

Your work is saved in this browser as you type.

Loading editor…
Input for Run

Run tries your code on the input above and shows what it prints. Submit checks your output against every test, including hidden ones.

Shortcut: Ctrl + Enter sends it to the judge.

Tanvir's Live Range Query System · DIU ContestHub