#P8773. [蓝桥杯 2022 省 A] 选数异或
[蓝桥杯 2022 省 A] 选数异或
Problem Description
Given a sequence of length and a non-negative integer , there are queries. Each query asks whether it is possible to choose two numbers from some interval such that their XOR equals .
Input Format
The first line contains three integers .
The second line contains integers .
The next lines each contain two integers , representing the query interval .
Output Format
For each query, if there exist two numbers in the interval whose XOR is , output yes; otherwise output no.
4 4 1
1 2 3 4
1 4
1 2
2 3
3 3
yes
no
yes
no
Hint
[Sample Explanation]
Obviously, in the entire sequence, only the XOR of 2 and 3 equals 1.
[Test Case Scale and Constraints]
For of the test cases, .
For of the test cases, .
For all test cases, , , , and .
Lanqiao Cup 2022 Provincial Contest A Group, Problem D.
Translated by ChatGPT 5