結果

問題 No.378 名声値を稼ごう
ユーザー lloyz
提出日時 2023-02-01 00:00:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 121 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 52,860 KB
最終ジャッジ日時 2024-06-30 23:59:31
合計ジャッジ時間 919 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = 0
res = 0
while n > 0:
    ans = max(ans, res + 2 * n)
    res += n
    n //= 2
print(ans - res)
0