Sequence and Queries 28
Time limit1sMemory limit512 MB
Maintain an array under range add, range floor-sqrt, and range sum queries, and report each range sum.
- Level
Hard8 of 10
- Topics
- Segment tree, Math, Linked list, Implementation
- Solved
- No attempts yet
Problem
You are given a sequence of length . Write a program that performs the following queries.
1 L R X: for every , apply .2 L R: for every , apply .3 L R: print .
Input
The first line gives the size of the sequence, . ()
The second line gives . ()
The third line gives the number of queries, . ()
Each of the next lines contains one query. (, ) At least one query of type 3 is given.
Output
For each query of type 3, print its result on its own line.