时间限制:C/C++/Rust/Pascal 8秒,其他语言16秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
64bit IO Format: %lld
题目描述
Given a sequence of integers

, you need to process

operations.
In an operation

, you need to change

to

, and then query how many different

satisfies that there exists

that

s.t.

.
Operations are NOT independent.
There is no

s.t.
输入描述:
The first line contains two integers
.
The next line contains
integers
.
For the next
lines, each line contains an integer
, representing an operation.
输出描述:
For each operation, output an integer in a line representing the answer.
示例1
输入
复制
6 5
4 2 5 5 4 4
2
5
5
3
6