結果

問題 No.939 and or
ユーザー tails1434
提出日時 2020-01-02 09:21:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 53,872 KB
最終ジャッジ日時 2024-11-22 17:43:13
合計ジャッジ時間 2,882 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    A, B = map(int, input().split())
    if A > B:
        print(0)

    cnt = 1
    for i in range(40):
        if A & (1 << i):
            if B & (1 << i):
                cnt *= 1
            else:
                cnt *= 0
        else:
            if B & (1 << i):
                cnt *= 2
            else:
                cnt *= 1

    if cnt == 1:
        print(cnt)
        exit()
    else:
        print(cnt // 2)



if __name__ == "__main__":
    main()
0