結果

問題 No.939 and or
ユーザー tnodinotnodino
提出日時 2022-08-10 20:59:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 397 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 10,136 KB
最終ジャッジ日時 2023-10-21 06:03:23
合計ジャッジ時間 2,113 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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) // 2)
0