結果
| 問題 | 
                            No.939 and or
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-05-01 01:14:30 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 44 ms / 2,000 ms | 
| コード長 | 311 bytes | 
| コンパイル時間 | 169 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 51,968 KB | 
| 最終ジャッジ日時 | 2024-07-19 05:03:31 | 
| 合計ジャッジ時間 | 2,554 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 30 | 
ソースコード
A,B=map(int, input().split())
cnt=1
for i in range(32):
    if (A>>i)&1==1 and (B>>i)&1==1: # (1,1)
        cnt*=1
    if (A>>i)&1==0 and (B>>i)&1==1: # (1,0),(0,1)
        cnt*=2
    if (A>>i)&1==1 and (B>>i)&1==0: #
        cnt*=0
    if (A>>i)&1==0 and (B>>i)&1==0: # (0,0)
        cnt*=1
print((cnt-1)//2+1)