結果

問題 No.3150 count X which satisfies with equlation
ユーザー Shivam kumar Singh
提出日時 2025-05-20 21:35:32
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 76,872 KB
実行使用メモリ 76,084 KB
最終ジャッジ日時 2025-06-20 02:59:20
合計ジャッジ時間 6,408 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda: sys.stdin.readline().rstrip()


def solve():
    a, b = map(int, input().split())  
    ans = 1
    ok = True
    for i in range(0, 30):
        if(((a & (1 << i)) != 0) & ((b & (1 << i)) != 0)):
            ans *= 2
        if(((a & (1 << i)) != 0) and ((b & (1 << i)) == 0)):
            ok = False
    if(ok):
        print(ans)
    else:
        print(0)

t = 1
# t = int(input())
for _ in range(t):
    solve()
0