結果

問題 No.45 回転寿司
ユーザー tachyon777tachyon777
提出日時 2020-02-13 13:38:38
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 190 bytes
コンパイル時間 330 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 65,752 KB
最終ジャッジ日時 2024-04-15 17:29:02
合計ジャッジ時間 2,497 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,080 KB
testcase_01 AC 39 ms
52,676 KB
testcase_02 AC 39 ms
53,452 KB
testcase_03 AC 39 ms
53,952 KB
testcase_04 AC 39 ms
52,208 KB
testcase_05 AC 38 ms
52,164 KB
testcase_06 AC 39 ms
52,944 KB
testcase_07 AC 39 ms
52,728 KB
testcase_08 AC 39 ms
52,556 KB
testcase_09 AC 39 ms
53,100 KB
testcase_10 AC 39 ms
52,668 KB
testcase_11 AC 38 ms
52,896 KB
testcase_12 AC 39 ms
53,192 KB
testcase_13 AC 38 ms
52,280 KB
testcase_14 AC 38 ms
53,220 KB
testcase_15 AC 38 ms
52,464 KB
testcase_16 AC 39 ms
52,740 KB
testcase_17 AC 39 ms
52,140 KB
testcase_18 AC 38 ms
52,492 KB
testcase_19 AC 39 ms
52,636 KB
testcase_20 AC 39 ms
52,648 KB
testcase_21 AC 38 ms
53,276 KB
testcase_22 AC 38 ms
52,392 KB
testcase_23 AC 38 ms
52,916 KB
testcase_24 AC 38 ms
53,180 KB
testcase_25 RE -
testcase_26 AC 39 ms
52,280 KB
testcase_27 AC 40 ms
53,292 KB
testcase_28 AC 39 ms
53,072 KB
testcase_29 AC 39 ms
52,824 KB
testcase_30 AC 39 ms
52,272 KB
testcase_31 AC 37 ms
53,232 KB
testcase_32 WA -
testcase_33 AC 39 ms
52,856 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
lst1 = list(map(int,input().split()))

dp = [0]*n

dp[0] = lst1[0]
dp[1] = max(lst1[0],lst1[1])

for i in range(1,n):
    dp[i] = max(dp[i-1],dp[i-2]+lst1[i])

print(dp[-1])
0