212252026-01-12 17:14:22algoproSzigetek (35 pont)pypy3Runtime error 27/3579ms32000 KiB
# UUID: 1a92bbb6-a111-439a-ac84-56b6e61bf4c7

N = int(input())
D = [int(x) for x in input().split()]

DP = [D[0], abs(D[0]+D[1])]

for i in range(2,len(D)):
    megoldas=min(DP[i-2]+D[i],DP[i-1]+D[i])
    DP.append(megoldas)
print(DP[-1])
SubtaskSumTestVerdictTimeMemory
base27/35
1Accepted0/041ms19428 KiB
2Runtime error0/072ms32000 KiB
3Accepted1/139ms19404 KiB
4Accepted1/143ms19388 KiB
5Accepted1/146ms19432 KiB
6Accepted1/143ms19432 KiB
7Accepted1/139ms19436 KiB
8Accepted2/250ms21052 KiB
9Accepted2/256ms21496 KiB
10Accepted2/250ms21600 KiB
11Accepted2/248ms21476 KiB
12Accepted2/257ms21736 KiB
13Accepted2/250ms21544 KiB
14Accepted2/261ms23272 KiB
15Accepted2/254ms23760 KiB
16Accepted2/265ms25668 KiB
17Accepted2/264ms29940 KiB
18Accepted2/267ms31648 KiB
19Runtime error0/279ms32000 KiB
20Runtime error0/279ms32000 KiB
21Runtime error0/279ms32000 KiB
22Runtime error0/270ms32000 KiB