結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2018-06-24 22:53:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 45 ms / 5,000 ms |
コード長 | 248 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 52,352 KB |
最終ジャッジ日時 | 2024-12-27 19:11:27 |
合計ジャッジ時間 | 2,994 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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))