結果
| 問題 |
No.822 Bitwise AND
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-10-29 21:12:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 339 bytes |
| コンパイル時間 | 339 ms |
| コンパイル使用メモリ | 82,252 KB |
| 実行使用メモリ | 84,532 KB |
| 最終ジャッジ日時 | 2025-10-29 21:12:45 |
| 合計ジャッジ時間 | 6,780 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 16 |
ソースコード
N,K = map(int,input().split())
if N == 0:
if K == 0:
print(0)
else:
print("INF")
exit()
Q = []
for i in range(N,N+100000):
if N & i == N:
Q.append(i)
ans = 0
for q1 in Q:
for q2 in Q:
if q1 < q2:
break
if q1 & q2 == N and q1 - q2 <= K:
ans += 1
print(ans)
ntuda