結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2018-06-24 22:54:41 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 41 ms / 5,000 ms |
コード長 | 248 bytes |
コンパイル時間 | 127 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-27 19:12:03 |
合計ジャッジ時間 | 2,767 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
n = int(input()) lst = list(map(int,input().split())) if n>=3: lst2 = [lst[0],max(lst[0],lst[1])] for i in range(2,n): mx = max(lst2[i-2]+lst[i],lst2[i-1]) lst2.append(mx) print(max(lst2[-2:])) else: print(max(lst))