結果
問題 |
No.939 and or
|
ユーザー |
![]() |
提出日時 | 2020-08-06 02:34:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 555 bytes |
コンパイル時間 | 225 ms |
コンパイル使用メモリ | 81,616 KB |
実行使用メモリ | 55,152 KB |
最終ジャッジ日時 | 2024-09-18 22:31:51 |
合計ジャッジ時間 | 2,636 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 |
ソースコード
import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict con = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) #処理内容 def main(): A, B = getlist() val = 0 jud = 1 for i in range(35): if A % 2 == 1 and B % 2 == 0: jud = 0 break elif A % 2 == 0 and B % 2 == 1: val += 1 A >>= 1; B >>= 1 if jud == 0: print(0) else: if val == 0: print(1) else: ans = 2 ** (val - 1) print(ans) if __name__ == '__main__': main()