結果

問題 No.822 Bitwise AND
ユーザー pasoconhoshiipasoconhoshii
提出日時 2019-04-27 09:28:56
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,004 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 77,140 KB
最終ジャッジ日時 2023-09-08 01:13:05
合計ジャッジ時間 10,634 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,004 ms
77,140 KB
testcase_01 AC 104 ms
76,564 KB
testcase_02 AC 75 ms
76,120 KB
testcase_03 AC 69 ms
71,188 KB
testcase_04 AC 1,003 ms
77,032 KB
testcase_05 AC 520 ms
77,028 KB
testcase_06 AC 881 ms
76,924 KB
testcase_07 AC 1,004 ms
76,708 KB
testcase_08 AC 1,003 ms
76,680 KB
testcase_09 AC 868 ms
77,080 KB
testcase_10 AC 67 ms
71,388 KB
testcase_11 AC 67 ms
71,440 KB
testcase_12 AC 973 ms
76,880 KB
testcase_13 AC 74 ms
76,204 KB
testcase_14 AC 69 ms
71,408 KB
testcase_15 AC 585 ms
76,992 KB
testcase_16 AC 94 ms
76,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, K = map(int, input().split())
if N < K :
    print("INF")
    exit()

ans = 0
for x in range(10**6):
    for k in range(K+1):
        y = x + k
        if (x & y) == N:
            ans += 1
print(ans)
0