結果
| 問題 | No.939 and or |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-01 01:14:30 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 109 ms |
| コンパイル使用メモリ | 85,028 KB |
| 実行使用メモリ | 138,188 KB |
| 最終ジャッジ日時 | 2026-04-02 14:20:18 |
| 合計ジャッジ時間 | 1,846 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)