結果

問題 No.45 回転寿司
ユーザー momike1341
提出日時 2020-03-28 01:17:54
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 187 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-01-02 10:21:59
合計ジャッジ時間 2,683 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

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

DP=[0 for i in range(N+1)]
DP[1]=V[0]

for i in range(1,N):
    max_num=max(DP[:i])
    DP[i+1]=max([max_num+V[i],max_num])
print(max(DP))
0