結果

問題 No.939 and or
ユーザー tnodinotnodino
提出日時 2022-08-10 20:58:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 392 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 81,596 KB
実行使用メモリ 65,740 KB
最終ジャッジ日時 2023-10-21 06:02:40
合計ジャッジ時間 2,957 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 38 ms
53,344 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 35 ms
53,344 KB
testcase_06 RE -
testcase_07 WA -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 WA -
testcase_19 RE -
testcase_20 AC 34 ms
53,344 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 36 ms
53,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B = map(int,input().split())
N = A.bit_length()
M = B.bit_length()
bit1 = [0] * 30
bit2 = [0] * 30
for i in range(N):
    if A & (1 << i):
        bit1[i] = 1
for i in range(M):
    if B & (1 << i):
        bit2[i] = 1
cnt = 0
for i in range(30):
    if bit1[i] == 1 and bit2[i] == 0:
        print(0)
        exit()
    if bit1[i] == 0 and bit2[i] == 1:
        cnt += 1
print(pow(2, cnt))
0