시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 66 | 24 | 22 | 36.667% |
There are $N$ balls on the number line, each of diameter $1$, numbered from $1$ through $N$. Ball $i$'s leftmost point is located at position $p_i$. Additionally, there is an immovable wall located at position $P$. You have to process $Q$ queries of one of the following forms:
Calculate the final positions of the balls.
The first line contains three integers $N$, $Q$, and $P$: the initial number of balls, the number of queries, and the position of the wall ($1 \leq N, Q \leq 10^5$, $N \leq P \leq 10^9$).
The second line contains $N$ integers $p_1, p_2, \ldots, p_N$ ($0 \leq p_i < P$). It is guaranteed the positions are distinct.
The next $Q$ lines describe the queries and may have one of the following forms:
Print out the final positions of the balls in increasing order on a single line, separated by spaces.
2 1 5 1 3 2
2 4
5 3 10 1 8 3 7 2 2 1 4 2
1 3 5 6 8 9