結果

問題 No.45 回転寿司
ユーザー Akijin_007
提出日時 2022-11-04 14:08:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 5,000 ms
コード長 263 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 60,288 KB
最終ジャッジ日時 2024-07-18 13:43:06
合計ジャッジ時間 2,172 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = int(input())
V = list(map(int, input().split()))

dp = [0, 0]

for i in range(N):
    ndp = [0, 0]
    ndp[0] = max(dp)
    ndp[1] = dp[0] + V[i]
    dp = list(ndp)

print(max(dp))



0