Sequence and Queries 18
Time limit2sMemory limit512 MB
Maintain an array under point updates and answer range queries counting elements greater than k.
- Level
Hard8 of 10
- Topics
- Segment tree, Sorting, Binary search, Array
- Solved
- No attempts yet
Problem
You are given a sequence of length . Write a program that processes the following queries.
1 i j k: print the number of elements among that are greater than .2 i k: change to .
The sequence is indexed from 1.
Input
The first line contains the length of the sequence ().
The second line contains ().
The third line contains the number of queries ().
Each of the next lines contains one query in the format described above (, ).
Output
For each query of type 1, print the answer on its own line.