No.1957 Xor Min
レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 159
作問者 : 👑
tute7627
/ テスター :
PCTprobability
タグ : / 解いたユーザー数 159
作問者 : 👑
tute7627
/ テスター :
PCTprobability
問題文最終更新日: 2022-05-27 21:10:28
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.
Show the original
yukicoder contest 345
(順位表)
の他の問題:
Problem Statement
You are given integers $A, B$.
Find the maximum value of $\min (x, y, x \oplus y)$ over integers $x,y$ satisfying $0 \le x \le A$ and $0 \le y \le B$.
Here, $\oplus$ denotes the bitwise exclusive OR.
Input
$A \ B$
- All inputs are integers.
- $1 \le A,B \le 10^9$
Output
Output the maximum value of $\min (x, y, x \oplus y)$. Print a newline at the end.
Sample
Sample 1
Input
2 3
Output
1
If $x = 2, y = 1$, then $x \oplus y = 3$, and $\min (x, y, x \oplus y) = 1$.
On the other hand, if $x = 2, y = 2$, then $x \oplus y = 0$, and $\min (x, y, x \oplus y) = 0$.
Sample 2
Input
3 4
Output
3
Sample 3
Input
998244353 924844033
Output
536870911
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。