#abc223h. H - Xor Query
H - Xor Query
Score : points
问题描述
给定一个包含 个正整数的序列 。
处理 个查询。在第 ()个查询中,判断是否可以从 中选择一个或多个元素,使得它们的按位异或值为 。
什么是按位异或()?
对于整数 和 的按位异或运算 定义如下:
- 当 以二进制表示时,位于 位()上的数字是 ,当且仅当 和 中恰好有一个是 ;否则为 。
例如,我们有 (以二进制表示:)。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Given is a sequence of positive integers .
Process queries. In the -th query , determine whether it is possible to choose one or more elements from so that their is .
What is ?
The bitwise of integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if exactly one of and is , and otherwise.
For example, we have (in base two: ).
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain Yes
if it is possible to choose one or more elements from so that their is , and No
otherwise.
Sample Input 1
5 2
3 1 4 1 5
1 3 7
2 5 7
Sample Output 1
Yes
No
In the first query, you can choose and , whose is .
In the second query, there is no way to choose elements so that their is .
Sample Input 2
10 10
8 45 56 9 38 28 33 5 15 19
10 10 53
3 8 60
1 10 29
5 7 62
3 7 51
8 8 52
1 4 60
6 8 32
4 8 58
5 9 2
Sample Output 2
No
No
Yes
No
Yes
No
No
No
Yes
Yes
update @ 2024/3/10 09:50:27