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: Time Limit Exceeded):
def main():
    N = int(input())
    arr = []
    product = 1
    # while i < N:
    arr = list(map(int , input().split(' ')))

    if 0 in arr:
        print(0)
        return

    for i in arr:
        if( int(i) == 0):
            exit
        product = product * int(i)

    if product <= (10**18):
        print(product)
    else:
        print(-1)

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: Time Limit Exceeded):
N = int(input())
arr = []
product = 1
# while i < N:
arr = ((input().split(' ')))

for i in arr:
    if( int(i) == 0):
        exit
    product = product * int(i)

if product <= (10**18):
    print(product)
else:
    print(-1)

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 = int(input())
arr = []
product = 1
# while i < N:
arr = ((input().split(' ')))

for i in arr:
    if( int(i) == 0):
        print(0)
        return
    product = product * int(i)

if product <= (10**18):
    print(product)
else:
    print(-1)

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 = int(input())
arr = []
product = 1
# while i < N:
arr = ((input().split(' ')))

for i in arr:
    if( i == 0):
        print(0)
        return
    product = product * int(i)

if product <= (10**18):
    print(product)
else:
    print(-1)

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):
N = int(input())
arr = []
product = 1
# while i < N:
arr = ((input().split(' ')))

for i in arr:
    product = product * int(i)

if product <= (10**18):
    print(product)
else:
    print(-1)

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 ()