Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
result = 1

if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  
if result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
result = 1
 
for a in A:
  result *= a

if result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
result = 1
 
for a in A:
  result *= a
  
if 0 in A:
  print(0)
elif result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = map(int, input().split())
result = 1
 
for a in As:
  result *= a
  
if 0 in As:
  print(0)
elif result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
As = map(int, input().split())
result = 1
 
for a in As:
  result *= a
  
if 0 in As:
  print(0)
  return
if result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = map(int, input().split())
result = 1
 
for a in As:
  result *= a
 
if result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
result = 1
 
for a in As:
  result *= a
 
if result > 10**18:
  print(-1)
else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)

Buggy python submission (verdict: Runtime Error):
N = int(input())
As = map(int, input().split())
result = 1
 
for a in As:
  result *= a
 
if result >= 10**18:
  print("-1")
 else:
  print(result)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
 
if 0 in A:
  print(0)
  exit()

for a in A:
  result *= a
  if result > 10**18:
    print(-1)
    exit()

print(result)