QOJ.ac

QOJ

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

#18783. 数列とクエリ 25

Estadísticas

入力

最初の行には数列のサイズ $N$ が与えられる。( $1 \le N \le 200{,}000$ )

2 行目には $A_1, A_2, \ldots, A_N$ が与えられる。( $0 \le A_i < 2^{20}$ )

3 行目にはクエリの個数 $M$ が与えられる。( $1 \le M \le 200{,}000$ )

4 行目から $M$ 行目にはそれぞれクエリが与えられる。( $1 \le L \le R \le N$, $0 \le X < 2^{20}$ ) タイプ 3 のクエリが少なくとも 1 つ存在する。

出力

タイプ 3 の各クエリに対して、結果を 1 行ずつ出力せよ。

入出力例

入力 1

5
1 3 2 5 4
8
3 1 3
2 1 1 5
3 1 3
1 1 4 6
2 3 4 1
3 2 3
2 2 3 4
3 1 5

出力 1

3
5
3
7

注記

数列は次のように変化する。

  • 1, 3, 2, 5, 4
  • 5, 3, 2, 5, 4
  • 5, 3, 2, 5, 4
  • 4, 2, 2, 4, 4
  • 4, 2, 3, 5, 4
  • 4, 2, 3, 5, 4
  • 4, 6, 7, 5, 4
  • 4, 6, 7, 5, 4

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.