結果

問題 No.45 回転寿司
ユーザー ronpooronpoo
提出日時 2023-08-22 10:31:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 5,000 ms
コード長 201 bytes
コンパイル時間 1,020 ms
コンパイル使用メモリ 87,012 KB
実行使用メモリ 75,160 KB
最終ジャッジ日時 2023-08-22 10:31:47
合計ジャッジ時間 5,410 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,752 KB
testcase_01 AC 85 ms
74,736 KB
testcase_02 AC 78 ms
75,156 KB
testcase_03 AC 77 ms
74,772 KB
testcase_04 AC 77 ms
74,896 KB
testcase_05 AC 73 ms
71,224 KB
testcase_06 AC 75 ms
74,656 KB
testcase_07 AC 77 ms
74,808 KB
testcase_08 AC 72 ms
70,936 KB
testcase_09 AC 75 ms
74,892 KB
testcase_10 AC 73 ms
70,588 KB
testcase_11 AC 72 ms
70,936 KB
testcase_12 AC 75 ms
74,536 KB
testcase_13 AC 73 ms
70,928 KB
testcase_14 AC 73 ms
70,808 KB
testcase_15 AC 72 ms
71,148 KB
testcase_16 AC 72 ms
70,576 KB
testcase_17 AC 69 ms
70,908 KB
testcase_18 AC 71 ms
71,116 KB
testcase_19 AC 74 ms
74,724 KB
testcase_20 AC 70 ms
71,124 KB
testcase_21 AC 71 ms
70,592 KB
testcase_22 AC 71 ms
71,152 KB
testcase_23 AC 70 ms
70,872 KB
testcase_24 AC 71 ms
70,800 KB
testcase_25 AC 71 ms
71,352 KB
testcase_26 AC 71 ms
71,064 KB
testcase_27 AC 74 ms
75,160 KB
testcase_28 AC 71 ms
71,344 KB
testcase_29 AC 73 ms
75,088 KB
testcase_30 AC 74 ms
75,084 KB
testcase_31 AC 70 ms
71,244 KB
testcase_32 AC 74 ms
71,072 KB
testcase_33 AC 74 ms
74,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [[0]*(2) for _ in range(N+1)]
for i in range(N):
    dp[i+1][0] = max(dp[i])
    dp[i+1][1] = dp[i][0] + V[i]
    
ans = max(dp[N])
print(ans)
0