#P8526. [Ynoi2078] 《How to represent part-whole hierarchies in a neural network》阅读报告(更新中...)
[Ynoi2078] 《How to represent part-whole hierarchies in a neural network》阅读报告(更新中...)
Problem Description
Given a sequence and queries. Each query gives . You need to compute the bitwise XOR sum of the weights of all pairs that satisfy . The weight of a pair is .
Input Format
The first line contains two integers .
The next line contains integers .
The next lines each contain two integers , representing one query.
Output Format
Output lines, each being the answer to the corresponding query.
5 2
1 1 1 2 4
1 5
3 5
3
2
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
For another of the testdata, .
For another of the testdata, for all , .
For another of the testdata, for all , .
Constraints: for of the testdata, , , and all values are integers.
Translated by ChatGPT 5