QOJ.ac

QOJ

Süre Sınırı: 2 s Bellek Sınırı: 256 MB Toplam puan: 100

#18796. 序列与查询 38

İstatistikler

最初有一个包含一个 0 的数组 $A$。接下来需要执行以下查询:

  • 1 x:在 $A$ 的末尾添加 x
  • 2 x:从 $A$ 中删除 x。如果 $A$ 中有两个或更多个 x,则只删除最前面出现的一个。保证查询中 $A$ 中一定包含 x
  • 3:输出 $A$ 中所有元素的和。
  • 4:输出 $A$ 中所有元素的异或值。

输入格式

第一行包含一个整数 $M$,表示查询的数量。接下来 $M$ 行,每行一个查询。

输出格式

每当出现类型 3 或类型 4 的查询时,输出答案,每个答案占一行。

样例

输入样例 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.