結果

問題 No.45 回転寿司
ユーザー Akijin_007
提出日時 2022-11-04 14:08:40
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 263 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 281 ms
コンパイル使用メモリ 85,480 KB
実行使用メモリ 143,872 KB
最終ジャッジ日時 2026-04-02 07:04:41
合計ジャッジ時間 2,854 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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