結果

問題 No.45 回転寿司
ユーザー かいかい
提出日時 2023-06-19 02:54:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 208 bytes
コンパイル時間 448 ms
コンパイル使用メモリ 86,640 KB
実行使用メモリ 71,116 KB
最終ジャッジ日時 2023-09-08 20:39:21
合計ジャッジ時間 5,272 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,116 KB
testcase_01 AC 75 ms
70,956 KB
testcase_02 AC 76 ms
70,972 KB
testcase_03 AC 76 ms
70,860 KB
testcase_04 AC 76 ms
71,032 KB
testcase_05 AC 75 ms
71,008 KB
testcase_06 AC 76 ms
70,844 KB
testcase_07 AC 77 ms
70,932 KB
testcase_08 AC 76 ms
70,572 KB
testcase_09 AC 77 ms
70,936 KB
testcase_10 AC 77 ms
71,000 KB
testcase_11 AC 78 ms
70,904 KB
testcase_12 AC 78 ms
70,968 KB
testcase_13 AC 78 ms
71,024 KB
testcase_14 AC 76 ms
70,904 KB
testcase_15 AC 77 ms
70,944 KB
testcase_16 AC 77 ms
70,972 KB
testcase_17 AC 76 ms
70,784 KB
testcase_18 AC 74 ms
70,680 KB
testcase_19 AC 76 ms
70,932 KB
testcase_20 AC 75 ms
71,024 KB
testcase_21 AC 74 ms
70,864 KB
testcase_22 AC 77 ms
70,700 KB
testcase_23 AC 76 ms
70,728 KB
testcase_24 AC 75 ms
71,084 KB
testcase_25 AC 75 ms
71,044 KB
testcase_26 AC 76 ms
70,576 KB
testcase_27 AC 76 ms
70,968 KB
testcase_28 AC 76 ms
70,864 KB
testcase_29 AC 77 ms
70,944 KB
testcase_30 AC 76 ms
70,872 KB
testcase_31 AC 77 ms
70,956 KB
testcase_32 AC 74 ms
71,032 KB
testcase_33 AC 77 ms
70,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [[0, 0] for _ in range(N+1)]

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