Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input().split(" "))
for i in range n:
    total=1
    for x in m:
        total *= m

if total<10000000000000000
    print(total)
else:
    print("-1")

Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):

z=0
total=1
N=int(input()) #take the N value
    
while z<N: #show how many number of multiplication
    A=int(input()) #Inout from user
    total*=A #multiplication
    z+=1 #increment
    
num1=10**18   
num2=10**5

if N>=2 and N<=num2: #make sure input N is 2<=N<=10^5
    if A>=0 and A<=num1: #make sure input A is 1<A<10^18
        if total>num1:
            print(-1) #over the limit, show -1
            
            
        else:
            print(total) #inside limit, show total
    else:   
        print('Wrong input') #tell the user that the input is wrong
else:
    print('Wrong input') #tell the user that the input is wrong



Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
def mulallnumber(numbers): #Function to multiply all numbers in list
   x=1
   for i in numbers:
      x*=i
      return x

A=list() #Creates a list

N=int(input("Enter the size of the list ::")) #size of list

print("Enter the element of list ::")
for i in range(int(N)):
   k=int(input(""))
   A.append(k) #append number in list

if mulallnumber(A)<1000000000000000000:
    print(mulallnumber(A))
else:
    print('-1') #will print '-1' if it exceeds 10^18


Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input()) #get input N
a=list(map(int, input().split())) #get input A
b=1 #first to multiply

for i in a:#multiply all list in A
    b*=i

if b>1000000000000000000: #if more than 10^18
    print("-1")

else: 
    print (b)

Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input()) #number of input

a = list(map(int,input().strip().split()))[:n] #ask input to multiple in one line

result = 1 
for x in a:
    result = result * x #update result(multiple of all)


if result<=10**18:
    print(result)

else:
    print(-1)

Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
result=1
for i in (a):
    result *= i
 # Multiply elements one by one
if result> (10**18):
     print("-1")
else:
     print(result)


Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
result=1
for i in (a):
    result = result * i
 # Multiply elements one by one 
if result> (10**18):
     print("-1")
else:
     print(result)


Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Runtime Error):
def mulallnumber(lst):
   x=1
   for i in lst:
      x=x*i
      return x

A=list()

N=int(input("Enter the size of the list ::"))

print("Enter the element of list ::")
for i in range(int(N)):
   k=int(input(""))
   A.append(k)

if mulallnumber(A)<1000000000000000000:
    print(mulallnumber(A))
else:
    print('-1')


Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a=int(input())
tem = 1
if a != 0:
    b=input().split(" ")
    for i in range(a):
        tem = tem * int(b[i])
    if tem> 10**18:
        tem = -1
print(tem)

Fixed submission:
# we collect the input A1 upto An.
# limit cannot exceed 10**18
# if N = 0 then ans = 0
# in N is in range then compute ans * A[n]
# else if  ans is greater than limit then display 1
# finally if length equal 1 then display -1
N = int(input())
ans = 1
limit = 10 ** 18
length = 0

A = list(map(int, input().split()))

A0 = set(A)
if 0 in A0:
    ans = 0
else:
    pass

for n in range(N):
    ans = ans * A[n]
    if ans == 0:
        break
    elif ans > limit:
        length = 1
        break
    else:
        pass

if length == 1:
    print(-1)
else:
    print(ans)