QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 256 MB Puntuación total: 100

#18796. 数列とクエリ 38

Estadísticas

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

  • 1 xx を $A$ の末尾に追加する。
  • 2 x:$A$ から x を削除する。$A$ に x が2つ以上含まれている場合、最初の出現のみを削除する。クエリの時点で $x$ が $A$ に存在することが保証される。
  • 3:$A$ の全要素の総和を出力する。
  • 4:$A$ の全要素の XOR を出力する。

入力

最初の行に整数 $M$ が与えられる。これはクエリの個数である。次の $M$ 行にはそれぞれ1つのクエリが与えられる。

出力

タイプ3またはタイプ4のクエリが現れるたびに、答えをそれぞれ1行ずつ出力せよ。

入出力例

入力例 1

12
1 3
1 1
1 4
3
4
1 1
3
4
2 1
2 4
3
4

出力例 1

8
6
9
7
4
2

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.