#abc238d. D - AND and SUM
D - AND and SUM
Score : points
问题描述
对于 个测试用例,解决以下问题。
给定非负整数 和 。是否存在一对非负整数 满足以下两个条件?
什么是按位 ?
整数 和 的按位 (记作 )定义如下:
- 当 以二进制形式表示时,在 位()上的数字是:如果 和 在该位上都是 ,则为 ,否则为 。
例如,我们有 (以二进制表示:)。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Solve the following problem for test cases.
Given are non-negative integers and . Is there a pair of non-negative integers that satisfies both of the conditions below?
What is bitwise ?
The bitwise of integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if those of and are both , and otherwise.
For example, we have (in base two: ).
Constraints
- All values in input are integers.
Input
Input is given from Standard Input. The first line is in the following format:
Then, test cases follow. Each test case is in the following format:
Output
Print lines. The -th line should contain Yes
if, in the -th test case, there is a pair of non-negative integers that satisfies both of the conditions in the Problem Statement, and No
otherwise.
Sample Input 1
2
1 8
4 2
Sample Output 1
Yes
No
In the first test case, some pairs such as satisfy the conditions.
In the second test case, no pair of non-negative integers satisfies the conditions.
Sample Input 2
4
201408139683277485 381410962404666524
360288799186493714 788806911317182736
18999951915747344 451273909320288229
962424162689761932 1097438793187620758
Sample Output 2
No
Yes
Yes
No
update @ 2024/3/10 10:17:23