問題一覧 > 通常問題

No.3149 find X which satisfies with equlation

レベル : / AI推定難易度 : 101 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 136
作問者 : Cafe1942 / テスター : kazuppa sclara
お気に入りにしたユーザー ProblemId : 12264 / 自分の提出
問題文最終更新日: 2025-05-20 20:20:28
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
Math Cafe 1 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。