QOJ.ac

QOJ

Süre Sınırı: 1 s Bellek Sınırı: 512 MB Toplam puan: 100

#18778. 序列与查询 20

İstatistikler

有一个数组 $A$,其中包含一个 $0$。接下来,需要执行以下查询:

  • 1 x:向 $A$ 中添加 $x$。
  • 2 x:从 $A$ 中删除 $x$。如果 $A$ 中有两个或更多个 $x$,则只删除一个。保证查询时 $A$ 中一定存在 $x$。
  • 3 x:将 $A$ 中的每个元素分别与 $x$ 进行异或运算,然后输出其中的最大值。

输入格式

第一行包含一个整数 $M$ $(1 \le M \le 200{,}000)$,表示查询的个数。接下来 $M$ 行,每行给出一个查询。输入中给出的 $x$ 是小于等于 $10^9$ 的自然数。

3 号查询至少出现一次。

输出格式

依次输出执行查询的结果。

样例

输入格式 1

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

输出格式 1

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.