結果
| 問題 |
No.378 名声値を稼ごう
|
| コンテスト | |
| ユーザー |
_KingdomOfMoray
|
| 提出日時 | 2020-01-05 08:33:40 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 612 bytes |
| コンパイル時間 | 92 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-07-02 21:30:46 |
| 合計ジャッジ時間 | 788 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 5 |
ソースコード
import math
n = int(input())
normal_list = []
cumula_list = [] # cumulative_list
skill_list = []
cur = n
while True:
normal_list.append(cur)
cur = 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])
_KingdomOfMoray