結果

問題 No.939 and or
ユーザー neterukunneterukun
提出日時 2019-12-09 01:08:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 249 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2025-01-03 00:19:46
合計ジャッジ時間 3,075 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())

ans = 0
for i in range(32):
    if (a >> i & 1) and not (b >> i & 1):
        print(0)
        exit()
    if not (a >> i & 1) and (b >> i & 1):
        ans += 1
if ans == 0:
    print(1)
else:
    print(2**ans // 2)
0