結果

問題 No.822 Bitwise AND
コンテスト
ユーザー kohei2019
提出日時 2022-04-19 23:55:19
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 376 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 63 ms
コンパイル使用メモリ 81,580 KB
実行使用メモリ 70,404 KB
最終ジャッジ日時 2026-10-10 08:19:59
合計ジャッジ時間 1,965 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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