Distributive Property
시간 제한5초메모리 제한2048 MB
집합의 원소를 넣고 빼는 갱신과 함께, 모든 원소 x에 대해 (x+t)의 XOR을 구하는 질의에 답한다.
문제
You are given a set of distinct integers. You will also receive queries, each of one of the following two types:
-
Query Type 1 ( ):
- If is currently in the set , remove it.
- Otherwise, add to the set.
-
Query Type 2 ( ):
- Print the cumulative bitwise XOR of over all . Formally, print .
입력
The first line of the input contains two integers and () --- the initial size of the set and the number of queries, respectively.
The next line of the input will contain distinct integers () --- the initial set.
The next lines of the input will describe the queries. Each of them will contain a query of the form or (), representing the query in the format described above.
It is guaranteed that there is at least one query of type .
출력
For each query of type , print the cumulative bitwise XOR of over all .
힌트
In the sample case, at the time of the first type query, we have . Since for this query, we print the value At the time of the second type query, we have . Since for this query, we print the value