結果

問題 No.939 and or
ユーザー irumo8202
提出日時 2022-01-31 12:52:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-11 08:47:16
合計ジャッジ時間 2,090 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())

conv_bit = lambda x: f"{x:b}"
zero_paddings = lambda x: f"{x:032}"

bitA = zero_paddings(int(conv_bit(A)))
bitB = zero_paddings(int(conv_bit(B)))

ans = 1
for a, b in zip(bitA, bitB):
    if a == b:
        continue
    elif a == "1":
        ans *= 0
    else:
        ans *= 2

print(ans if ans <= 1 else ans // 2)
0