結果

問題 No.822 Bitwise AND
ユーザー titiatitia
提出日時 2019-04-26 23:13:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 340 bytes
コンパイル時間 1,741 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 76,768 KB
最終ジャッジ日時 2023-08-16 17:14:35
合計ジャッジ時間 11,980 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,145 ms
76,752 KB
testcase_01 AC 102 ms
76,480 KB
testcase_02 WA -
testcase_03 AC 69 ms
70,992 KB
testcase_04 AC 795 ms
76,516 KB
testcase_05 AC 427 ms
76,768 KB
testcase_06 AC 717 ms
76,500 KB
testcase_07 AC 789 ms
76,620 KB
testcase_08 AC 874 ms
76,548 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 842 ms
76,256 KB
testcase_13 WA -
testcase_14 AC 68 ms
71,184 KB
testcase_15 AC 473 ms
76,256 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
N,K=map(int,input().split())

if N==0 and K!=0:
    print("INF")
    sys.exit()

for i in range(30):
    if (1<<i) &N==0:
        break

if K<=(1<<i):
    print("INF")
    sys.exit()   
    
ANS=0
for x in range(N,10**6):
    for i in range(K+1):
        if x & (x+i)==N:
            ANS+=1

print(ANS)
0