結果

問題 No.378 名声値を稼ごう
ユーザー gorugo30
提出日時 2021-02-23 21:18:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 52,996 KB
最終ジャッジ日時 2024-09-22 15:34:43
合計ジャッジ時間 860 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

def calcfame(n, i):
    ret = 0
    itr = 0
    while n > 0:
        if i == itr:
            ret += 2 * n
            break
        ret += n
        n //= 2
        itr += 1
    return ret

N = int(input())
f0 = calcfame(N, 10000000000000)
maxf = 0
for i in range(31):
    maxf = max(maxf, calcfame(N, i))
print(maxf - f0)
0