#P17625. [qaswed12 OI R1] Xor Xor Mex
[qaswed12 OI R1] Xor Xor Mex
背景
还有第三关?
题目描述
Gcend 在配置 T4 的数据时,发现自己根本不会写 checker.cpp!所以他需要你帮忙实现 checker.cpp。
qaswed12 给出了一个长度为 的整数序列 ,你需要求出:
$$\bigoplus\limits_{l=1}^{n}\bigoplus\limits_{r=l}^{n}\operatorname{mex}(l,r)$$其中 定义为在 中未出现的最小非负整数。
符号与 符号的定义类似,求和变为求异或和,以及 符号表示两数按位异或。
输入格式
第一行,一个整数 ,表示数组的长度。
第二行,一共 个整数,表示 。
输出格式
一行,一个整数,表示答案。
3
1 0 1
3
提示
样例解释 #1
$\begin{aligned} & \bigoplus\limits_{l=1}^{3}\bigoplus\limits_{r=l}^{3}\operatorname{mex}(l,r) \\ = & \operatorname{mex}(1,1) \oplus \operatorname{mex}(1,2) \oplus \operatorname{mex}(1,3) \oplus \operatorname{mex}(2,2) \oplus \operatorname{mex}(2,3) \oplus \operatorname{mex}(3,3) \\ = & \,0 \oplus 2 \oplus 2 \oplus 1 \oplus 2 \oplus 0 \\ = & \,3 \end{aligned}$
数据范围与规定
本题开启捆绑测试。
| 子任务编号 | 特殊性质 | 分值 | |
|---|---|---|---|
| 无 | |||
| 序列中 的个数 | |||
| ^ | 序列仅由 构成 | ||
| 无 | |||
| ^ |
对于 的数据,,。