220852026-01-14 16:51:11algoproSzigetek (35 pont)pypy3Accepted 35/3575ms31792 KiB
# UUID: 4267eb85-e8a7-4986-bf4b-596fd84b4fb8
n=int(input())
ár=[int(x) for x in input().split()]
dp=[0]*(n+1)
dp[0]=ár[0]
dp[1]=ár[1]+ár[0]
for i in range(2,n):
    dp[i]=min(dp[i-1],dp[i-2])+ár[i]
print(dp[-2])
SubtaskSumTestVerdictTimeMemory
base35/35
1Accepted0/039ms19300 KiB
2Accepted0/075ms31716 KiB
3Accepted1/143ms19480 KiB
4Accepted1/139ms19316 KiB
5Accepted1/139ms19504 KiB
6Accepted1/139ms19388 KiB
7Accepted1/145ms19412 KiB
8Accepted2/248ms21224 KiB
9Accepted2/257ms21540 KiB
10Accepted2/259ms21656 KiB
11Accepted2/250ms21628 KiB
12Accepted2/256ms21564 KiB
13Accepted2/257ms21552 KiB
14Accepted2/252ms22340 KiB
15Accepted2/261ms23216 KiB
16Accepted2/264ms25576 KiB
17Accepted2/272ms28648 KiB
18Accepted2/264ms29384 KiB
19Accepted2/274ms30552 KiB
20Accepted2/264ms30696 KiB
21Accepted2/275ms31792 KiB
22Accepted2/265ms31792 KiB