結果
| 問題 |
No.822 Bitwise AND
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2025-10-29 21:15:18 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 338 bytes |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 82,404 KB |
| 実行使用メモリ | 66,256 KB |
| 最終ジャッジ日時 | 2025-10-29 21:15:25 |
| 合計ジャッジ時間 | 6,820 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 WA * 3 TLE * 1 |
ソースコード
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+40000):
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