結果
問題 |
No.822 Bitwise AND
|
ユーザー |
|
提出日時 | 2022-04-20 00:13:51 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 259 ms / 2,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 344 ms |
コンパイル使用メモリ | 82,112 KB |
実行使用メモリ | 76,208 KB |
最終ジャッジ日時 | 2025-01-02 20:37:45 |
合計ジャッジ時間 | 2,912 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
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(N+1): for j in range(0,K+1): x = i+N y = x+j if x & y == N: cnt += 1 if not (len(bin(x)) == len(bin(y))): print('INF') exit() print(cnt)