結果
| 問題 |
No.939 and or
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-12-04 10:39:01 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 525 bytes |
| コンパイル時間 | 258 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-11-30 00:27:42 |
| 合計ジャッジ時間 | 2,089 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 WA * 5 |
ソースコード
A, B = map(int, input().split())
binA = format(A, 'b')
binB = format(B, 'b')
if len(binA)<=len(binB):
binA = '0'*(len(binB)-len(binA))+binA
else:
binB = '0'*(len(binA)-len(binB))+binB
c1, c2, c3, c4 = 0, 0, 0, 0
for binA_i, binB_i in zip(binA, binB):
if binA_i=='1' and binB_i=='1':
c1 += 1
elif binA_i=='1' and binB_i=='0':
c2 += 1
elif binA_i=='0' and binB_i=='1':
c3 += 1
elif binA_i=='0' and binB_i=='0':
c4 += 1
if c2>0:
print(0)
else:
print(2**(c3-1))