QOJ.ac

QOJ

时间限制: 1 s 内存限制: 512 MB 总分: 100

#18778. 数列とクエリ20

统计

配列 $A$ があり、最初は $0$ のみが含まれています。その後、以下のクエリを実行する必要があります。

  • 1 x: $A$ に $x$ を追加する。
  • 2 x: $A$ から $x$ を削除する。$A$ に $x$ が2つ以上含まれている場合は、1つだけ削除する。このクエリが実行される時、$x$ が $A$ に存在することは保証される。
  • 3 x: $A$ の各要素に対して、$x$ とのビットごとの XOR を計算し、その中での最大値を出力する。

入力

最初の行には整数 $M$ $(1 \le M \le 200{,}000)$ が含まれ、クエリの数を表す。次の $M$ 行にはそれぞれ1つのクエリが記述される。入力で与えられる全ての $x$ は $0$ 以上 $10^9$ 以下の整数である。

タイプ3のクエリは少なくとも1回出現する。

出力

クエリの結果を順に出力せよ。

入出力例

入力例 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.