221082026-01-14 17:07:11algoproSzigetek (35 pont)pypy3Runtime error 31/3579ms32000 KiB
# UUID: d6fe9086-b92b-43c4-a6ff-d15f8cb49702
N=int(input())
d=list(map(int,input().split()))
dp=[0]*N
dp[0]=d[0]
dp[1]=d[0]+d[1]
for i in range(2, N):
    dp[i]=min(dp[i-1], dp[i-2])+d[i]
print(dp[N-1])
SubtaskSumTestVerdictTimeMemory
base31/35
1Accepted0/045ms19400 KiB
2Runtime error0/075ms32000 KiB
3Accepted1/139ms19544 KiB
4Accepted1/139ms19416 KiB
5Accepted1/146ms19432 KiB
6Accepted1/139ms19432 KiB
7Accepted1/137ms19428 KiB
8Accepted2/250ms21228 KiB
9Accepted2/248ms21576 KiB
10Accepted2/248ms21564 KiB
11Accepted2/256ms21520 KiB
12Accepted2/259ms21736 KiB
13Accepted2/248ms21696 KiB
14Accepted2/252ms23404 KiB
15Accepted2/261ms24556 KiB
16Accepted2/265ms27128 KiB
17Accepted2/261ms29644 KiB
18Accepted2/264ms30768 KiB
19Accepted2/279ms31876 KiB
20Accepted2/275ms31992 KiB
21Runtime error0/264ms32000 KiB
22Runtime error0/265ms32000 KiB