QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 512 MB مجموع النقاط: 100

#18778. Dãy số và Truy vấn 20

الإحصائيات

Có một mảng $A$ ban đầu chứa một phần tử $0$. Sau đó, cần thực hiện các truy vấn sau:

  • 1 x: Thêm $x$ vào $A$.
  • 2 x: Loại bỏ $x$ khỏi $A$. Nếu $A$ chứa hai hoặc nhiều bản sao của $x$, chỉ loại bỏ một bản sao. Dữ liệu đảm bảo rằng $x$ tồn tại trong $A$ khi truy vấn này được thực hiện.
  • 3 x: Với mỗi phần tử trong $A$, thực hiện phép XOR bit với $x$, sau đó đưa ra giá trị lớn nhất trong số chúng.

Dữ liệu vào

Dòng đầu tiên chứa một số nguyên $M$ $(1 \le M \le 200{,}000)$, số lượng truy vấn. $M$ dòng tiếp theo mỗi dòng mô tả một truy vấn. Tất cả $x$ được cho trong dữ liệu vào là các số nguyên không âm không vượt quá $10^9$.

Truy vấn loại 3 xuất hiện ít nhất một lần.

Dữ liệu ra

Đưa ra kết quả của các truy vấn theo thứ tự.

Ví dụ

Đầu vào 1

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

Đầu ra 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.