[R15D]二维异或和
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
时空限制
1S/512M
题目描述
给定一个长度为 的整数数组 。
定义区间 的二维异或和为 ,这里的 表示按位异或运算。
有 个询问,第 个询问求区间 的二维异或和。
格式
输入格式
第一行包含两个整数 ,分别表示数组 的长度和询问的数量。
第二行包含 个整数 。
接下来 行每行两个整数 ,表示第 个询问。
输出格式
输出 个整数,第 个整数表示第 个询问的答案。
样例
样例输入 #1
5 3
1 3 2 7 6
1 3
3 4
5 5
样例输出 #1
12 10 0
样例解释 #1
第 个询问的答案为 $(1\oplus 1)+(1\oplus 3)+(1\oplus 2)+(3\oplus 1)+(3\oplus 3)+(3\oplus 2)+(2\oplus 1)+(2\oplus 3)+(2\oplus 2)=0+2+3+2+0+1+3+1+0=12$。
第 个询问的答案为 $(2\oplus 2)+(2\oplus 7)+(7\oplus 2)+(7\oplus 7)=0+5+5+0=10$。
第 个询问的答案为 。
数据规模
对于 的数据,,。
对于 的数据,,。
对于 的数据,,,,。
代码源挑战赛 Round 15
- Status
- Done
- Rule
- DMY
- Problem
- 6
- Start at
- 2025-6-6 20:00
- End at
- 2025-6-6 21:30
- Duration
- 1.5 hour(s)
- Host
- Partic.
- 579