QOJ.ac

QOJ

시간 제한: 1 s 메모리 제한: 512 MB 총점: 100

#18778. 수열과 쿼리 20

통계

$0$이 하나 포함되어 있는 배열 $A$가 있다. 이때, 다음 쿼리를 수행해야 한다.

  • 1 x: $A$에 $x$를 추가한다.
  • 2 x: $A$에서 $x$를 제거한다. $A$에 $x$가 두 개 이상 있는 경우에는 하나만 삭제한다. 항상 $A$에 $x$가 있는 쿼리만 주어진다.
  • 3 x: $A$에 포함된 각각의 원소와 $x$를 XOR 연산을 한 다음, 가장 큰 값을 출력한다.

입력

첫째 줄에 쿼리의 개수 $M$ $(1 \le M \le 200{,}000)$이 주어진다. 둘째 줄부터 $M$개의 줄에 쿼리가 주어진다. 입력으로 주어지는 $x$의 범위는 $10^9$보다 작거나 같은 자연수이다.

$3$번 쿼리는 하나 이상 주어진다.

출력

쿼리를 수행한 결과를 출력한다.

Sample

Input

10
1 8
1 9
1 11
1 6
1 1
3 3
2 8
3 3
3 8
3 11

Output

11
10
14
13

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.