結果

問題 No.822 Bitwise AND
ユーザー kohei2019kohei2019
提出日時 2022-04-19 23:55:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 76,992 KB
最終ジャッジ日時 2023-08-30 22:05:27
合計ジャッジ時間 2,729 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 66 ms
71,556 KB
testcase_02 AC 67 ms
71,312 KB
testcase_03 AC 65 ms
71,412 KB
testcase_04 WA -
testcase_05 AC 71 ms
75,656 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 71 ms
76,044 KB
testcase_09 AC 70 ms
75,920 KB
testcase_10 WA -
testcase_11 AC 66 ms
71,296 KB
testcase_12 AC 71 ms
76,420 KB
testcase_13 AC 68 ms
71,160 KB
testcase_14 AC 69 ms
71,288 KB
testcase_15 AC 72 ms
75,632 KB
testcase_16 AC 67 ms
71,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K = map(int,input().split())
ans = 0
if N == 0 and K ==0:
    print(1)
    exit()
if N == 0 and 0 < K:
    print('INF')
    exit()
cnt = 0
for i in range(K+1):
    for j in range(i,K+1):
        x = i+N
        y = j+N
        if x & y == N:
            cnt += 1
            if not (len(bin(x)) == len(bin(y))):
                print('INF')
                exit()
print(cnt)
0