No.3149 find X which satisfies with equlation
Problem Statement
Print the unique integer $X$ that satisfies $A \oplus X = B$.
Here, $\oplus$ denotes the bitwise XOR in binary representation. For example, $ (7)_{10} \oplus (5)_{10} = (111)_2 \oplus (101)_2 = (010)_2 = (2)_{10}$.
What is XOR?
For numbers $a$,$b$, each of which is either $0$ or $1$, $a$ $\oplus$ $b$ is defined to be $1$ if the values of $a$ and $b$ differ, and $0$ otherwise.Constraints
- $0 \leq A,B \leq 255$
- All inputs are integers.
Input
The input is given from standard input in decimal in the following format.$A$ $B$
Output
Print the unique integer $X$ that satisfies the equation, in decimal.
Sample
Sample 1
Input
1 2
Output
3
The unique integer $X$ that satisfies $ (1)_{10} \oplus X = (2)_{10}$ is $(3)_{10}$.
This is because $ (1)_{10} \oplus (3)_{10} = (01)_2 \oplus (11)_2 = (10)_2 = (2)_{10}$.
Sample 2
Input
11 5
Output
14
The unique integer $X$ that satisfies $ (11)_{10} \oplus X = (5)_{10}$ is $(14)_{10}$.
Sample 3
Input
240 121
Output
137
The unique integer $X$ that satisfies $ (240)_{10} \oplus X = (121)_{10}$ is $(137)_{10}$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
Cafe1942
kazuppa