結果
| 問題 |
No.822 Bitwise AND
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-20 00:12:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 213 ms / 2,000 ms |
| コード長 | 374 bytes |
| コンパイル時間 | 1,173 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 76,160 KB |
| 最終ジャッジ日時 | 2025-01-02 20:35:34 |
| 合計ジャッジ時間 | 2,941 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
N,K = map(int,input().split())
ans = 0
if N == 0 and K ==0:
print(1)
exit()
if N == 0 and 0 < K:
print('INF')
exit()
cnt = 0
for i in range(2*N):
for j in range(0,K+1):
x = i
y = i+j
if x & y == N:
cnt += 1
if not (len(bin(x)) == len(bin(y))):
print('INF')
exit()
print(cnt)