Buggy python submission (verdict: Time Limit Exceeded):
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
 
    if ans>1000000000000000000:
        print("-1")
    else:
        print(ans)
main()

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys

n = int(input())
a=sys.stdin.readline().rstrip().split()
 
ans=1
 
for i in a:
    ans=ans*int(i)
 
if ans>1000000000000000000:
    print("-1")
else:
    print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=list(map(int,input().split()))

if n%2==0:
	ans=1
	for i in range(n//2):
		ans=ans*a[i]*a[i+n//2]
else:
	if n==1:
		ans=a[0]
	else:
		ans=a[0]
		for i in range(1,(n-1)//2+1):
			ans=ans*a[i]*a[i+(n-1)//2]

if ans>1000000000000000000:
	print("-1")
else:
	print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
a=list(map(int,input().split()))

if n%2==0:
	ans=1
	for i in range(n//2):
		ans=ans*a[i]*a[i+n//2]
else:
	if n==1:
		ans=a[0]
	else:
		ans=a[0]
		for i in range(1,i(n-1)//2+1):
			ans=ans*a[i]*a[i+(n-1)//2]

if ans>1000000000000000000:
	print("-1")
else:
	print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Runtime Error):
n = int(input())
a=list(map(int,input().split()))

if n%2==0:
	ans=1
	for i in range(n/2):
		ans=ans*a[i]*a[i+n/2]
else:
	if n==1:
		ans=a[0]
	else:
		ans=a[0]
		for i in range(1,int((n-1)/2)+1):
			ans=ans*a[i]*a[i+int((n-1)/2)]

if ans>1000000000000000000:
	print("-1")
else:
	print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Runtime Error):
from collections import deque

n = int(input())
a=list(map(int,input().split()))

if n%2==0:
	ans=1
	for i in range(n/2):
		ans=ans*a[i]*a[i+n/2]
else:
	if n==1:
		ans=a[0]
	else:
		ans=a[0]
		for i in range(1,int((n-1)/2)+1):
			ans=ans*a[i]*a[i+int((n-1)/2)]

if ans>1000000000000000000:
	print("-1")
else:
	print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=tuple(map(int,input().split()))

ans=1

for i in a:
    ans=ans*i

if ans>1000000000000000000:
    print("-1")
else:
    print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=list(map(int,input().split()))
 
ans=1
 
for i in a:
    ans=ans*i
 
if ans>1000000000000000000:
    print("-1")
else:
    print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a=list(map(int,input().split()))

ans=1

for i in a:
    ans=ans*i

if ans>1000000000000000000:
    print("-1")
else:
    print(ans)

Fixed submission:
import sys

def main():
    n = int(input())
    a=sys.stdin.readline().rstrip().split()
    if '0' in a:
        print(0)
        return
    ans=1
 
    for i in a:
        ans=ans*int(i)
        if ans>1000000000000000000:
            print("-1")
            return
    else:
        print(ans)
main()