結果

問題 No.939 and or
ユーザー 1235486527
提出日時 2019-12-21 10:34:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 176 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-07-19 02:42:30
合計ジャッジ時間 1,853 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

def num_of_bits(bits):
    return bin(bits).count('1')

N, M = map(int, input().split())
if N & M != N:
    print(0)
else:
    a = num_of_bits(N ^ M)
    print(2**max(0, a-1))
0