結果

問題 No.378 名声値を稼ごう
コンテスト
ユーザー _KingdomOfMoray
提出日時 2020-01-05 07:51:28
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 623 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 462 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-05-16 20:37:44
合計ジャッジ時間 1,952 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

n = int(input())

normal_list = []
cumula_list = [] # cumulative_list
skill_list = []
cur = n

while True:
    normal_list.append(cur)
    cur = math.floor(cur / 2)
    if cur < 1:
        break

for i in range(len(normal_list)):
    if i == 0:
        cumula_list.append(normal_list[i])
    else:
        cumula_list.append(cumula_list[i - 1] + normal_list[i])
        
for i in range(len(normal_list)):
    if i == 0:
        skill_list.append(2 * cumula_list[i])
    else:
        skill_list.append(cumula_list[i - 1] + 2 * normal_list[i])
        
print(max(skill_list) - cumula_list[len(cumula_list) - 1])
0