220912026-01-14 16:54:57algoproSzigetek (35 pont)pypy3Accepted 35/3579ms31724 KiB
# UUID: a5e4385c-b137-498f-b024-54c5430a1bd3
n=int(input())
lista = [int(x) for x in input().split()]
dp=[0]*n
dp[0]=lista[0]
dp[1]=lista[1]+lista[0]
for i in range(n-2):
    dp[i+2]=min(dp[i],dp[i+1])+lista[i+2]
print(dp[n-1])
SubtaskSumTestVerdictTimeMemory
base35/35
1Accepted0/041ms19332 KiB
2Accepted0/079ms31724 KiB
3Accepted1/141ms19480 KiB
4Accepted1/148ms19332 KiB
5Accepted1/146ms19444 KiB
6Accepted1/141ms19364 KiB
7Accepted1/143ms19520 KiB
8Accepted2/252ms21060 KiB
9Accepted2/257ms21564 KiB
10Accepted2/250ms21668 KiB
11Accepted2/259ms21496 KiB
12Accepted2/259ms21648 KiB
13Accepted2/252ms21528 KiB
14Accepted2/265ms22300 KiB
15Accepted2/257ms23312 KiB
16Accepted2/268ms25672 KiB
17Accepted2/267ms28612 KiB
18Accepted2/267ms29584 KiB
19Accepted2/267ms30492 KiB
20Accepted2/275ms30636 KiB
21Accepted2/279ms31636 KiB
22Accepted2/268ms31692 KiB