結果

問題 No.822 Bitwise AND
ユーザー ああいいああいい
提出日時 2022-01-27 15:00:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 86,580 KB
実行使用メモリ 76,516 KB
最終ジャッジ日時 2023-08-26 15:14:57
合計ジャッジ時間 2,752 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 155 ms
75,920 KB
testcase_01 AC 65 ms
71,168 KB
testcase_02 AC 65 ms
70,884 KB
testcase_03 AC 65 ms
71,204 KB
testcase_04 AC 156 ms
76,268 KB
testcase_05 AC 110 ms
76,368 KB
testcase_06 AC 143 ms
76,516 KB
testcase_07 AC 155 ms
76,368 KB
testcase_08 AC 71 ms
76,516 KB
testcase_09 AC 68 ms
75,796 KB
testcase_10 AC 64 ms
71,248 KB
testcase_11 AC 66 ms
71,244 KB
testcase_12 AC 69 ms
76,224 KB
testcase_13 AC 69 ms
75,896 KB
testcase_14 AC 62 ms
71,204 KB
testcase_15 AC 116 ms
76,276 KB
testcase_16 AC 62 ms
70,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
import sys
if N < K:
    print('INF')
    exit()
n = 1
while n <= N:
    n <<= 1
ans = 0
for x in range(n):
    for y in range(x,x+K+1):
        if x & y == N:ans += 1
print(ans)
0