#P15664. [ICPC 2025 Jakarta R] AND and/or OR
[ICPC 2025 Jakarta R] AND and/or OR
题目描述
Suppose you have a non-negative integer . You can do two types of operations:
- ;
- ;
where and are the bitwise AND and bitwise OR operations, respectively.
You are given three integers , , and .
If the value of is initially , is there any sequence of operations that consists of operations of type 1 and operations of type 2, such that the final value of is for some non-negative integer ?
输入格式
Input consists of three integers , , and (, , ).
输出格式
Output a single line containing if it is possible to make the final value of equal to where is a non-negative integer, or otherwise.
14 2 2
YES
1 0 9
NO
提示
Initially, . You can do the following sequence of operations:
- Do a type 1 operation. .
- Do a type 1 operation. .
- Do a type 2 operation. .
- Do a type 2 operation. .
The final value of is .