結果

問題 No.939 and or
ユーザー pekempey
提出日時 2019-12-02 00:36:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 601 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 54,064 KB
最終ジャッジ日時 2024-11-22 00:14:56
合計ジャッジ時間 2,526 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

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