結果

問題 No.45 回転寿司
ユーザー gorugo30gorugo30
提出日時 2021-02-26 13:15:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 220 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 82,308 KB
実行使用メモリ 59,864 KB
最終ジャッジ日時 2024-04-10 04:52:31
合計ジャッジ時間 2,513 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,080 KB
testcase_01 AC 41 ms
57,540 KB
testcase_02 AC 41 ms
58,720 KB
testcase_03 AC 39 ms
59,012 KB
testcase_04 AC 39 ms
57,560 KB
testcase_05 AC 36 ms
53,220 KB
testcase_06 AC 38 ms
57,936 KB
testcase_07 AC 39 ms
59,564 KB
testcase_08 AC 36 ms
53,416 KB
testcase_09 AC 39 ms
59,684 KB
testcase_10 AC 37 ms
52,600 KB
testcase_11 AC 36 ms
52,792 KB
testcase_12 AC 40 ms
59,864 KB
testcase_13 AC 35 ms
53,004 KB
testcase_14 AC 35 ms
52,132 KB
testcase_15 AC 37 ms
52,584 KB
testcase_16 AC 36 ms
53,224 KB
testcase_17 AC 37 ms
53,756 KB
testcase_18 AC 37 ms
52,276 KB
testcase_19 AC 38 ms
58,452 KB
testcase_20 AC 34 ms
53,576 KB
testcase_21 AC 39 ms
53,140 KB
testcase_22 AC 34 ms
52,596 KB
testcase_23 AC 34 ms
53,284 KB
testcase_24 AC 34 ms
51,748 KB
testcase_25 AC 35 ms
52,284 KB
testcase_26 AC 35 ms
52,460 KB
testcase_27 AC 39 ms
58,076 KB
testcase_28 AC 35 ms
52,584 KB
testcase_29 AC 38 ms
57,796 KB
testcase_30 AC 38 ms
58,544 KB
testcase_31 AC 36 ms
53,384 KB
testcase_32 AC 35 ms
53,144 KB
testcase_33 AC 38 ms
59,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
V = list(map(int, input().split()))
dp = [[0] * 2 for i in range(N)]
dp[0][0] = 0
dp[0][1] = V[0]
for i in range(1, N):
    dp[i][0] = max(dp[i - 1])
    dp[i][1] = dp[i - 1][0] + V[i]
print(max(dp[-1]))
0