Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]
if 0 in a:
  print(0)
  break
A = 1
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    break
print(A)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]
a.sort()
A = 1
if a[0] == 0:
    A = 0
else: 
    for i in range(N):
        A = A * a[i]
if A > 1000000000000000000:
    print(-1)
else:
    print(A)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
A = 1
if a[0] == 0:
    A = 0
else: 
    for i in range(N):
        A = A * a[i]
if A > 1000000000000000000:
    print(-1)
else:
    print(A)


Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
A = 1
if a[0] == 0:
    print(0)
else: 
    for i in range(N):
        A = A * a[i]
if A > 1000000000000000000:
    print(-1)
else:
    print(A)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
    A = 0
else:
    for i in range(N):
        A = A * a[i]
        if A > 10**18:
            A = -1

print(A)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
    A = 0
else:
    for i in range(N):
        A = A * a[i]
if A > 1000000000000000000:
    print(-1)
else:
    print(A)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]
A = 1
for i in range(N):
    A = A * a[i]
if A > 1000000000000000000:
    print(-1)
else:
    print(A)

Fixed submission:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
  print(0)
  exit()
for i in range(N):
  A = A * a[i]
  if A > 1000000000000000000:
    print(-1)
    exit()
print(A)