#P10150. [Ynoi1999] TS-54
[Ynoi1999] TS-54
Background

Problem Description
Given an integer sequence , it is guaranteed that there do not exist such that .
There are operations. In each operation, an integer is given. First, perform a modification: reverse into . Then query how many distinct values satisfy that there exist such that .
Input Format
The first line contains two integers .
The second line contains integers representing in order.
The next lines each contain one integer , representing one operation.
Output Format
Output lines. Each line contains one integer, representing the answer to the query for each operation in order.
6 5
4 2 5 5 4 4
2
5
5
3
6
1
1
1
2
0
Hint
Idea: ccz181078, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
For of the testdata, all values are integers, , , and .
Translated by ChatGPT 5