結果
| 問題 | No.939 and or |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-07 18:38:06 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 2,000 ms |
| コード長 | 273 bytes |
| 記録 | |
| コンパイル時間 | 339 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-03-29 12:06:57 |
| 合計ジャッジ時間 | 4,392 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 |
ソースコード
import sys
A,B = list(map(int,input().split()))
count = 0
for i in range(32):
mask = 1 << i
if A & mask and B & mask == 0:
print(0)
exit()
if A & mask == 0 and B & mask:
count += 1
if A == B:
print(1)
else:
print(2 ** (count-1))