Buggy python submission (verdict: Runtime Error):
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = []

for j in range(1,N):
    F = A_list[:j]
    F_sum = sum(F)
    F_sum_list.append(F_sum)
    if F_sum >= all_sum // 2:
        break

mini = min(all_sum - 2 * F_sum_list[-2], -1*(all_sum - 2 * F_sum_list[-1]))
print(mini)

Fixed submission:
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = [int(item) for item in input().split()]
mini = 2020202020

all_sum = sum(A_list)

j = int(N/2+1)
is_search = True

while is_search:
    if j == 0:
        is_search = False

    F = A_list[:j]
    F_sum = sum(F)
    B_sum = all_sum - F_sum
    delta = B_sum - F_sum
    abs_delta = abs(B_sum - F_sum)
    if abs_delta <= mini:
        mini = abs_delta

    if delta > 0:
        j += int(j / 2)

    elif delta < 0:
        j = int(j / 2)
    else:
        mini = 0
        is_search = False

print(mini)


Fixed submission:
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = [int(item) for item in input().split()]
A_max = max(A_list)
mini = 2020202020 * 200000

all_sum = sum(A_list)

j = int(N/2+1)
is_search = True

while is_search:
    if j == 0:
        is_search = False

    F = A_list[:j]
    F_sum = sum(F)
    B_sum = all_sum - F_sum
    delta = B_sum - F_sum
    abs_delta = abs(B_sum - F_sum)
    if abs_delta <= mini:
        mini = abs_delta

    if delta > 0:
        j += int(j / 2)

    elif delta < 0:
        j = int(j / 2)
    else:
        mini = 0
        is_search = False

print(mini)

Fixed submission:
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))

Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
A_list = [int(item) for item in input().split()]
A_max = max(A_list)
mini = 2020202020 * 200000

all_sum = sum(A_list)

j = int(N/2+1)
is_search = True

while is_search:
    if j == 1:
        is_search = False

    F = A_list[:j]
    F_sum = sum(F)
    B_sum = all_sum - F_sum
    delta = B_sum - F_sum
    abs_delta = abs(B_sum - F_sum)
    if abs_delta <= mini:
        mini = abs_delta

    if delta > 0:
        j += int(j / 2)

    elif delta < 0:
        j = int(j / 2)
    else:
        mini = 0
        is_search = False

print(mini)

Fixed submission:
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = [int(item) for item in input().split()]

mini = 2020202020 * 200000

all_sum = sum(A_list)

for j in range(1,N):
    F = A_list[:j]
    F_sum = sum(F)
    B_sum = all_sum - F_sum

    delta = abs(B_sum - F_sum)
    if delta <= mini:
        mini = delta

print(mini)


Fixed submission:
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A_list = [int(item) for item in input().split()]

mini = 2020202020 * 200000
for j in range(1,N):
    F, B = A_list[:j], A_list[j:]
    delta = abs(sum(F) - sum(B))
    if delta <= mini:
        mini = delta

print(mini)

Fixed submission:
N = int(input())
A_list = [int(item) for item in input().split()]

all_sum = sum(A_list)

F_sum_list = [A_list[0]]

for j in range(1,N):
    F_sum_list.append(F_sum_list[-1] + A_list[j])

delta_list = [abs(all_sum - 2* i) for i in F_sum_list]

print(min(delta_list))