#P15664. [ICPC 2025 Jakarta R] AND and/or OR
[ICPC 2025 Jakarta R] AND and/or OR
Description
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 Format
Input consists of three integers , , and (, , ).
Output Format
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
Hint
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 .
京公网安备 11011102002149号