結果

問題 No.45 回転寿司
ユーザー tachyon777
提出日時 2020-02-13 13:38:38
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 190 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,284 KB
実行使用メモリ 65,624 KB
最終ジャッジ日時 2024-10-05 18:39:58
合計ジャッジ時間 2,602 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 29 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
lst1 = list(map(int,input().split()))

dp = [0]*n

dp[0] = lst1[0]
dp[1] = max(lst1[0],lst1[1])

for i in range(1,n):
    dp[i] = max(dp[i-1],dp[i-2]+lst1[i])

print(dp[-1])
0