結果
問題 |
No.45 回転寿司
|
ユーザー |
|
提出日時 | 2020-10-29 15:24:13 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 285 bytes |
コンパイル時間 | 242 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-21 22:33:35 |
合計ジャッジ時間 | 2,219 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
n = int(input()) levels = list(map(int, input().split())) max_sum = 0 if n == 1: max_sum = levels[0] elif n == 2: max_sum = max(levels) else: levels[2] += levels[0] for i in range(3, n): levels[i] += max(levels[:i-1]) max_sum = max(levels) print(max_sum)