QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 128 MB Total points: 100

#10132. TEST_34

الإحصائيات

给你一个长度为 n 的整数序列 $a_1$, $a_2$, $\ldots$, $a_n$ ,你需要实现以下两种操作,每个操作都可以用四个整数 $opt\;l\;r\;v$ 来表示:

$opt=1$ 时,代表把一个区间 $[l,r]$ 内的所有数都 xor 上 $v$。

$opt=2$ 时, 查询一个区间 $[l,r]$ 内选任意个数(包括 $0$ 个)数 xor 起来,这个值与 $v$ 的最大 xor 和是多少。

输入格式

第一行有两个正整数 $n,m$。

第二行有 $n$ 个整数表示给你的序列。

之后 $m$ 行每行有四个整数 $opt, l, r, v$表示一个操作。

输出格式

对于每个 $opt=2$ 的操作,输出一行一个数表示答案~

样例数据

样例输入

4 5
1 14 51 4
2 1 3 0
1 2 3 3
2 1 4 10
1 1 4 514
2 3 4 2

样例输出

61
63
560

子任务

Idea:nzhtl1477,Solution:nzhtl1477,Code:nzhtl1477,Data:nzhtl1477

对于 $100\%$ 的数据,满足 $1 \le n , m \le 5 \times 10^4$,值域在 $[0,10^9]$ 之间

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.