No.1432 Not Xor
レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 396
作問者 :
tyawanmusi
/ テスター :
itm_tech
タグ : / 解いたユーザー数 396
作問者 :
itm_tech
問題文最終更新日: 2021-02-21 14:10:37
English (AI translation)
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
yukicoder contest 287
(順位表)
の他の問題:
Problem Statement
For non-negative integers $A,B$, it holds that $(A\oplus B)=(A\ |\ B)-(A\ \And\ B)$. (Here, $\oplus\ ,\ |\ ,\ \And$ are the bitwise operators xor, or, and, respectively.)
By the way, find $(A\ |\ B)+(A\ \And\ B)$.
Constraints
- $A,B$ are integers
- $0 \le A,B < 10^9$
Input
$A\ B$
$A,B$ are given on $1$ line, separated by a space.
Output
Output $(A\ |\ B)+(A\ \And\ B)$ as an integer on $1$ line. Print a newline at the end.
Sample
Sample 1
Input
3 1
Output
4
Since $3\ |\ 1=3$ , $3\ \And\ 1=1$ , the answer is $3 + 1 = 4$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。