QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 512 MB Points totaux : 100

#18778. Ciąg i Zapytanie 20

Statistiques

Mamy tablicę $A$ zawierającą początkowo pojedyncze $0$. Następnie należy wykonać następujące zapytania:

  • 1 x: Dodaj $x$ do $A$.
  • 2 x: Usuń $x$ z $A$. Jeśli $A$ zawiera dwie lub więcej kopii $x$, usuń tylko jedną. Gwarantowane jest, że $x$ istnieje w $A$ w momencie wykonania tego zapytania.
  • 3 x: Dla każdego elementu w $A$ wykonaj bitowy XOR z $x$, a następnie wypisz maksymalną wartość spośród nich.

Wejście

Pierwszy wiersz zawiera liczbę całkowitą $M$ $(1 \le M \le 200\,000)$, liczbę zapytań. Kolejne $M$ wierszy opisuje po jednym zapytaniu. Wszystkie $x$ podane w danych wejściowych są nieujemnymi liczbami całkowitymi nieprzekraczającymi $10^9$.

Zapytanie typu 3 występuje co najmniej raz.

Wyjście

Wypisz wyniki zapytań w odpowiedniej kolejności.

Przykład

Wejście 1

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

Wyjście 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.