結果

問題 No.378 名声値を稼ごう
ユーザー _KingdomOfMoray_KingdomOfMoray
提出日時 2020-01-05 07:51:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 623 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-05-02 09:07:20
合計ジャッジ時間 709 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 25 ms
10,880 KB
testcase_02 AC 24 ms
10,880 KB
testcase_03 AC 25 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 27 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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