結果

問題 No.378 名声値を稼ごう
ユーザー gorugo30gorugo30
提出日時 2021-02-23 21:18:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 81,672 KB
実行使用メモリ 53,260 KB
最終ジャッジ日時 2023-10-23 22:15:11
合計ジャッジ時間 1,203 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,260 KB
testcase_01 AC 39 ms
53,260 KB
testcase_02 AC 39 ms
53,260 KB
testcase_03 AC 38 ms
53,260 KB
testcase_04 AC 39 ms
53,260 KB
testcase_05 AC 39 ms
53,260 KB
権限があれば一括ダウンロードができます

ソースコード

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