結果

問題 No.939 and or
ユーザー pekempeypekempey
提出日時 2019-12-02 00:36:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 53,580 KB
最終ジャッジ日時 2024-05-01 18:27:42
合計ジャッジ時間 2,498 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,372 KB
testcase_01 AC 43 ms
52,140 KB
testcase_02 AC 40 ms
52,528 KB
testcase_03 AC 41 ms
53,580 KB
testcase_04 AC 40 ms
52,472 KB
testcase_05 AC 39 ms
52,836 KB
testcase_06 AC 39 ms
52,220 KB
testcase_07 AC 41 ms
52,028 KB
testcase_08 AC 39 ms
52,008 KB
testcase_09 AC 39 ms
52,284 KB
testcase_10 AC 39 ms
53,196 KB
testcase_11 AC 39 ms
52,364 KB
testcase_12 AC 39 ms
52,760 KB
testcase_13 AC 40 ms
51,944 KB
testcase_14 AC 39 ms
52,344 KB
testcase_15 AC 40 ms
52,976 KB
testcase_16 AC 41 ms
53,160 KB
testcase_17 AC 40 ms
52,236 KB
testcase_18 AC 39 ms
52,488 KB
testcase_19 AC 40 ms
52,644 KB
testcase_20 AC 39 ms
52,348 KB
testcase_21 AC 39 ms
52,276 KB
testcase_22 AC 39 ms
51,760 KB
testcase_23 AC 40 ms
52,288 KB
testcase_24 AC 39 ms
53,020 KB
testcase_25 AC 39 ms
53,296 KB
testcase_26 AC 39 ms
52,108 KB
testcase_27 AC 40 ms
52,204 KB
testcase_28 AC 40 ms
52,556 KB
testcase_29 AC 39 ms
52,752 KB
testcase_30 AC 39 ms
52,392 KB
testcase_31 AC 39 ms
52,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())

ans = 1
for i in range(31):
  if (A >> i & 1) == 1 and (B >> i & 1) == 0:
    ans = 0
  elif (A >> i & 1) == 0 and (B >> i & 1) == 1:
    ans *= 2

if ans == 1:
  print(ans)
else:
  print(ans // 2)
0