Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n+1):
    a=int(input())
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    try:a=int(input())
    except:break
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n+1):
    try:a=int(input())
    except:break
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
import sys
dp=[0]+[1<<20]*10000
n=int(input())
a=list(map(int,sys.stdin.readlines()))
for i in range(1,len(a)):
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a[i-1]),(dp[i-j],dp[j]+a[i-1])])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
import sys
dp=[0]+[1<<20]*10000
n=int(input())
a=list(map(int,sys.stdin.readlines()))
for i in range(1,n):
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a[i-1]),(dp[i-j],dp[j]+a[i-1])])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
#???????????±???????????\????????°????????£?????????????
import sys
dp = [0] + [1 << 20] * 10000
n = int(input())
a = list(map(int, sys.stdin.readlines()))
if len(a)==n:a.pop()
for i in range(1, n) :
	for j in range(i//2+1):
		dp[j], dp[i - j] = map(min, [(dp[j], dp[i - j] + a[i - 1]), (dp[i - j], dp[j] + a[i - 1])])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])
try:raise RuntimeError
except:exit()

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])
exit()

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])

Buggy python submission (verdict: Runtime Error):
dp=[0]+[1<<20]*10000
n=int(input())
c=0
for i in range(1,n):
    if c==n-1:break
    a=int(input())
    c+=1
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

Fixed submission:
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])