| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 0.4 초 | 8 MB | 77 | 27 | 25 | 38.462% |
Consider two integers a and b. Their bitwise xor (exclusive or) is computed as it follows:
For example, 9 ^ 3 = 10 because 9 = 1001(2), 3 = 0011(2) and 10 = 1010(2).
You are given a sequence of N operations on a set of integers. The set is initially empty. Each operation can be one of the following:
You must print the output from every min-xor() operation.
The first line of the input contains the number of operations N. Each of the following lines describes an operation using the following syntax:
The output must contain a number of lines equals to the number of min-xor() operations. Each line must contain a single number, the answer to the corresponding min-xor() operation.
10 1 24 1 17 3 1 23 1 30 3 2 17 3 2 30 3
9 6 6 15
For the first min-xor(), the set is {24, 17}. The minimum bitwise xor is 24 ^ 17 = 9.
For the second min-xor(), the set is {24, 17, 23, 30}. The minimum bitwise xor is 24 ^ 30 = 6 (also 17 ^ 23 = 6).
For the third min-xor(), the set is {24, 23, 30}. The minimum bitwise xor is 24 ^ 30 = 6.
For the last min-xor(), the set is {24, 23}. The minimum bitwise xor is 24 ^ 23 = 15.