結果
問題 | No.822 Bitwise AND |
ユーザー |
|
提出日時 | 2019-11-05 21:14:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 335 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 24,384 KB |
最終ジャッジ日時 | 2024-09-15 00:13:01 |
合計ジャッジ時間 | 6,561 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 16 |
ソースコード
N, K = map(int, input().split()) if N + 1 <= K: if K == 0: print(1) else: print("INF") else: ans = 0 for y in range(N * (K + 1) + 1): if (y & N) != N: continue for x in range(max(0, y - K), y + 1)[:: -1]: if (y & x) == N: ans += 1 print(ans)