Buggy python submission (verdict: Time Limit Exceeded):
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
  	prod *= a
  if prod > 1000000000000000000:
    print(-1)
    return
  print(prod)
    
    
main ()


Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod)
main ()

Buggy python submission (verdict: Runtime Error):
def main ():
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
print(0)
return
prod = 1
for a in A:
prod *= a
if prod > 1000000000000000000:
print(-1)
return
print(prod)
main ()


Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod)
main ()

Buggy python submission (verdict: Runtime Error):
n,a = map(int.input().split())
b = list[]
for n:
  b.append(a)

c = a**n
if c > 10**18:
  c = -1
  print(c)


Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod)
main ()

Buggy python submission (verdict: Runtime Error):
n,a = map(int.input().split())
b = list[]
for n:
  b.append(a)

plint(a**n)


Fixed submission:
def main ():
  N = int(input())
  A = list(map(int,input(). split ()))
  
  if 0 in A:
    print(0)
    return
  prod = 1
  for a in A:
    prod *= a
    if prod > 1000000000000000000:
      print(-1)
      return
  print(prod)
main ()

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
res = 1 
if min(a) == 0:
  res = 0
else:
  for i in range(len(a)):
    res *= a[i]
    if res > 1000000000000000000:
      res = -1
      continue
print(res)

Fixed submission:
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
res = 1 
if 0 in a:
  res = 0
else:
  for num in a:
    res *= num
    if res > 10**18:
      res = -1
      break
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
res = 1 
if min(a) == 0:
  res = 0
else:
  for i in range(n):
    res *= a[i]
    if res > 1000000000000000000:
      res = -1
      continue
print(res)

Fixed submission:
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
res = 1 
if 0 in a:
  res = 0
else:
  for num in a:
    res *= num
    if res > 10**18:
      res = -1
      break
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
res = 1 
if min(a) == 0:
  res = 0
else:
  for i in range(n):
    res *= a[i]
    if res > 1000000000000000000:
      res = -1
      continue
print(res)

Fixed submission:
# -*- coding: utf-8 -*-
import math
n = int(input())
a = list(map(int, input().split()))
res = 1 
if 0 in a:
  res = 0
else:
  for num in a:
    res *= num
    if res > 10**18:
      res = -1
      break
print(res)