Bitwise Exclusive Or

AtCoder
IDabc213_a
Time2000ms
Memory256MB
Difficulty
You are given integers $A$ and $B$ between $0$ and $255$ (inclusive). Find a non-negative integer $C$ such that $A \text{ xor }C=B$. It can be proved that there uniquely exists such $C$, and it will be between $0$ and $255$ (inclusive). What is bitwise $\mathrm{XOR}$?The bitwise $\mathrm{XOR}$ of integers $A$ and $B$, $A\ \mathrm{XOR}\ B$, is defined as follows: * When $A\ \mathrm{XOR}\ B$ is written in base two, the digit in the $2^k$'s place ($k \geq 0$) is $1$ if exactly one of $A$ and $B$ is $1$, and $0$ otherwise. For example, we have $3\ \mathrm{XOR}\ 5 = 6$ (in base two: $011\ \mathrm{XOR}\ 101 = 110$). ## Constraints * $0\leq A,B \leq 255$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $A$ $B$ [samples]
Samples
Input #1
3 6
Output #1
5

When written in binary, $3$ will be $11$, and $5$ will be $101$. Thus, their $\text{xor}$ will be $110$ in binary, or $6$ in decimal.
In short, $3 \text{ xor } 5 = 6$, so the answer is $5$.
Input #2
10 12
Output #2
6

![image](https://img.atcoder.jp/ghi/7295a2123bac11ec5453c66bf19816fc.png)
API Response (JSON)
{
  "problem": {
    "name": "Bitwise Exclusive Or",
    "description": {
      "content": "You are given integers $A$ and $B$ between $0$ and $255$ (inclusive). Find a non-negative integer $C$ such that $A \\text{ xor }C=B$. It can be proved that there uniquely exists such $C$, and it will b",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc213_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given integers $A$ and $B$ between $0$ and $255$ (inclusive). Find a non-negative integer $C$ such that $A \\text{ xor }C=B$.\nIt can be proved that there uniquely exists such $C$, and it will b...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments