#P13981. 数列分块入门 6
数列分块入门 6
Background
The constraints of the testdata in Luogu's "Introduction to Sequence Block Decomposition" series differ from those of the original problems.
Problem Description
You are given a sequence of length and operations. The operations involve single-point insertion and single-point queries. The testdata are generated randomly; see the constraints for the generation method.
Input Format
The first line contains one integer .
The second line contains integers, where the -th integer is , separated by spaces.
Then lines follow, each describing one operation. Each line first contains one integer , separated by a space.
If , then two more integers follow on the same line, meaning that the integer is inserted right before the -th integer.
If , then one more integer follows on the same line, meaning that you should query the value of .
Output Format
For each query, output one integer on a single line giving the answer.
4
1 2 2 3
0 1 3
1 4
0 1 2
1 2
2
3
Hint
Subtasks
Subtask 1 (40 points): , .
Subtask 2 (60 points): , .
For all testdata, and . , and the number of integers currently present in the sequence when the operation is performed.
The testdata guarantee that, for each operation, is first generated uniformly at random as or with equal probability, and the remaining operation parameters are then drawn uniformly at random from all valid possibilities.
Translated by QwenWork