結果

問題 No.939 and or
ユーザー H20
提出日時 2020-11-26 14:04:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 54,304 KB
最終ジャッジ日時 2024-07-23 20:47:52
合計ジャッジ時間 2,512 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

def muzyun(A,B):
    while A:
        if A & 1 == 1 and B & 1 !=1:
            return True
        A >>= 1
        B >>= 1
    return False

A, B = map(int,input().split())
if muzyun(A,B):
    print(0)
    exit()
ans = 0

C = A^B
while C:
    if C & 1 == 1:
        ans+=1
    C >>= 1

print(max(1,2**(ans-1)))
0