当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7152:Copy

题目描述
Kayzin has a list of integers, initially the list is $a_1,a_2,\ldots,a_n$. He will execute $q$ operations.

For an operation of first type, he will select an interval $[l_i, r_i]$, copy and insert it to the end of the interval.

For an operation of second type, he wonder the $x_i$-th integer of the list.

You need to print the xor sum of all the answers of second type operations.

ps: What is xor? The xor value of two integers is equal to addition in binary without carry.

ps: $n$ is a constant for each test case.
输入解释
First line is an integer $T$, indicating the number of test cases. For each test case:

First line is 2 integers $n,q$, indicating the length of initial list and the number of operations.

Next line is $n$ integers $a_1,a_2,\ldots,a_n$, indicating the initial list.

Next $q$ line, one operation per line. The $i$-th line could be 3 integers ($1,l_i,r_i$), indicating the first type operation, or 2 integers ($2,x_i$), indicating the second type operation.

$1\le T \le 10,$ $1\le n,q\le 10^5,$ $1\le a_i\le 10^9,$ $\sum n \le 10^5,$ $\sum q \le 10^5,$ $1\le x_i,l_i,r_i \le n,$ the sum of the number of first type operations (all test cases together) not exceeds $20000$.
输出解释
For each test case, print one line, indicating the xor sum of the answers.
输入样例
1
5 3
1 2 3 4 5
2 4
1 2 4
2 5
输出样例
6
来自杭电HDUOJ的附加信息
Hint For first operation, the 4-th integer is 4.For second operation, $2, 3, 4$ is copied, the list becomes $1,2,3,4,2,3,4,5$.For third operation, the 5-th integer is 2.So the result is 2 xor 4 = 6

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7152

最后修改于 2022-09-15T06:17:02+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 262144/262144K(Java/Others)