Buggy python submission (verdict: Time Limit Exceeded):

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

if(0 in a):
    print("0")
    exit()

for i in range(int(n)):
    ans *= a[i]

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

Fixed submission:
n = input()
a = list(map(int, input().split(" ")))
ans = 1

if(0 in a):
    print("0")
    exit()

for i in range(int(n)):
    ans *= a[i]
    if(ans>10**18):
        print("-1")
        exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

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

for i in range(int(n)):
    ans *= a[i]

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

Fixed submission:
n = input()
a = list(map(int, input().split(" ")))
ans = 1

if(0 in a):
    print("0")
    exit()

for i in range(int(n)):
    ans *= a[i]
    if(ans>10**18):
        print("-1")
        exit()

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

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

for i in range(int(n)):
    ans *= a[i]

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

Fixed submission:
n = input()
a = list(map(int, input().split(" ")))
ans = 1

if(0 in a):
    print("0")
    exit()

for i in range(int(n)):
    ans *= a[i]
    if(ans>10**18):
        print("-1")
        exit()

print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
A=list(map(int,input().split()))
sum=1
f=0
f2=0
if 0 in a:
        f2=1
for a in A:
	sum=sum*a
	if (sum>10**18):
		sum=-1
                break
if f2==1: 
	print(0)
else:
	print(sum)

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

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

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=int(input())
sum=1
f=0
f2=0
for i in range(1,n):
	a=(input())
	if  (a==0): 
		f2=1
	sum=sum*a
	if (sum>10**18):
		sum=-1
                break
}
if f2==1: 
	print(0)
else:
	print(sum)

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=int(input())
sum=1
f=0
f2=0
for i in range(0,n):
	a=int(input())
	if  (a==0): 
		f2=1
	sum=sum*a
	if (sum>1000000000000000000):
		f=1;
}
if (f2==1): 
	print("0\n")
else if(f==1):
	print("-1\n")
else:
	print(sum)
	print("\n")

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=input()
sum=1
f=0
f2=0
for i in range(0,n):
	a=input()
	if  (a==0): 
		f2=1
	sum=sum*a
	if (sum>1000000000000000000):
		f=1;
}
if (f2==1): 
	print("0\n")
else if(f==1):
	print("-1\n")
else:
	print(sum)
	print("\n")

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=input()
sum=1
f=0
f2=0
for i in range(0,n):
	a=input()
	if  (a==0): 
		f2=1
	sum*=a
	if (sum>1000000000000000000):
		f=1;
}
if (f2==1): 
	print("0\n")
else if(f==1):
	print("-1\n")
else:
	print(sum)
	print("\n")

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=input()
sum=1
f=0
f2=0
for i in range(1,n):
	a=input()
	if (a==0): 
		f2=1
	sum*=a
	if (sum>1000000000000000000):
		f=1;
}
if(f2==1): 
	print("0\n")
else if(f==1):
	print("-1\n")
else:
	print(sum)
	print("\n")

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=(input())
		a=0
		sum=1
		f=0
		f2=0
		for i in range(1,n):
			a=(input())
			if(a==0): 
				f2=1
			sum*=a
			if (sum>1000000000000000000):
				f=1;
		}
		if(f2==1): 
			print("0\n")
		else if(f==1):
			print("-1\n")
		else:
			print(sum)
			print("\n")

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)

Buggy python submission (verdict: Runtime Error):
n=ll(input())
		a=0
		sum=1
		f=0
		f2=0
		for i in range(1,n):
			a=ll(input())
			if(a==0): 
				f2=1
			sum*=a
			if (sum>1000000000000000000):
				f=1;
		}
		if(f2==1): 
			print("0\n")
		else if(f==1):
			print("-1\n")
		else:
			print(sum)
			print("\n")

Fixed submission:
N=int(input())
 
A=list(map(int,input().split()))
 
if 0 in A:
    print(0)
else:
    result=1
    for a in A:
        result=result*a
        if result>10**18:
            result=-1
            break
    print(result)