結果

問題 No.589 Counting Even
ユーザー rlangevin
提出日時 2023-07-05 08:55:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 143 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2024-07-19 03:19:13
合計ジャッジ時間 2,262 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

def popcount(n):
    cnt = 0
    while n:
        cnt += n & 1
        n >>= 1
    return cnt

N = int(input())
print(N + 1 - 2 ** popcount(N))
0