結果

問題 No.939 and or
ユーザー brthyyjpbrthyyjp
提出日時 2020-11-25 19:58:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 487 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 71,464 KB
最終ジャッジ日時 2023-10-01 01:52:38
合計ジャッジ時間 4,059 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,268 KB
testcase_01 AC 73 ms
71,464 KB
testcase_02 AC 74 ms
71,260 KB
testcase_03 AC 72 ms
71,320 KB
testcase_04 AC 73 ms
71,104 KB
testcase_05 AC 73 ms
71,256 KB
testcase_06 AC 74 ms
71,220 KB
testcase_07 AC 73 ms
71,260 KB
testcase_08 AC 73 ms
71,148 KB
testcase_09 AC 72 ms
71,268 KB
testcase_10 AC 73 ms
71,336 KB
testcase_11 AC 73 ms
71,096 KB
testcase_12 AC 73 ms
71,088 KB
testcase_13 AC 73 ms
71,268 KB
testcase_14 AC 72 ms
71,316 KB
testcase_15 AC 74 ms
71,268 KB
testcase_16 AC 71 ms
71,168 KB
testcase_17 AC 73 ms
71,096 KB
testcase_18 AC 74 ms
71,116 KB
testcase_19 AC 73 ms
71,412 KB
testcase_20 AC 73 ms
71,164 KB
testcase_21 AC 73 ms
71,216 KB
testcase_22 AC 74 ms
71,396 KB
testcase_23 AC 74 ms
71,212 KB
testcase_24 AC 74 ms
71,376 KB
testcase_25 AC 73 ms
71,396 KB
testcase_26 AC 73 ms
71,312 KB
testcase_27 AC 73 ms
71,116 KB
testcase_28 AC 74 ms
71,256 KB
testcase_29 AC 73 ms
71,216 KB
testcase_30 AC 74 ms
71,008 KB
testcase_31 AC 74 ms
71,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,b = map(int, input().split())

if a == b:
    print(1)
    exit()

if a > b:
    print(0)
    exit()

ans = 1
a = list(format(a, 'b'))
b = list(format(b, 'b'))
a.reverse()
b.reverse()

if len(b) < len(a):
    b = b+['0']*(len(a)-len(b))
else:
    a = a+['0']*(len(b)-len(a))

for i, j in zip(a, b):
    if i == '0' and j == '1':
        ans *= 2
    elif i == '0' and j == '0':
        ans *= 1
    elif i == '1' and j == '1':
        ans *= 1
    else:
        ans = 0

print(ans//2)
0