Problem:


Score : 200 points

Problem Statement

Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N.

However, if the result exceeds 10^{18}, print -1 instead.

Constraints

2 \leq N \leq 10^5

0 \leq A_i \leq 10^{18}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
A_1 ... A_N

Output

Print the value A_1 \times ... \times A_N as an integer, or -1 if the value exceeds 10^{18}.

Sample Input 1

2
1000000000 1000000000

Sample Output 1

1000000000000000000

We have 1000000000 \times 1000000000 = 1000000000000000000.

Sample Input 2

3
101 9901 999999000001

Sample Output 2

-1

We have 101 \times 9901 \times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.

Sample Input 3

31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0

Sample Output 3

0



Sample input:
2
1000000000 1000000000


Sample output:
1000000000000000000

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 13 18:45:47 2020

@author: kawati
"""

N = int(input())

MAX = 10**18
ans = 1
a = list(map(int, input().split())) 

for x in a:
    ans *= x
    if ans > MAX:
        print(-1)

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  A = map(int, input().split())

  if 0 in A:
    print(0)
    return

  r, max = 1, 10 ** 18
  for num in A:
    r *= num
    if r > max:
      print(-1)
      return
  print(r)

main()

Submission status: Wrong Answer

Solution code:
def process():
  count = int(input())
  if count == 0:
    result = 0
  else:
    nums_str = input().split()
    nums_int = []
    for strn in nums_str:
      nums_int.append(int(strn))

      if 0 in nums_int:
        result = 0
        return result
      else:
        result = 1
        for intn in nums_int:
          result *= intn
          if result > 1000000000000000000:
            result = -1
            return result
    
print(process())

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  A = map(int, input().split())

  if 0 in A:
    return 0

  r, max = 1, 10 ** 18
  for num in A:
    r *= num
    if r > max:
      return -1
  return r

print(main())

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  A = map(int, input().split())

  if not all(A):
    return 0

  r, max = 1, 10 ** 18
  for num in A:
    r *= num
    if r > max:
      return -1
  return r

print(main())

Submission status: Wrong Answer

Solution code:
count = int(input())
if count == 0:
  result = 0
else:
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))
 
    result = 1
  
    for intn in nums_int:
      result *= intn
      if intn == 0:
        result = 0
        break
      if result > 10**18:
        result = -1
        break
    
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int, input().split())

if not all(A):
  print(0)
else:
  r, p = 1, 10 ** 18
  for num in A:
    if r > p:
      r = -1
      break
  print(r)

Submission status: Wrong Answer

Solution code:
count = int(input())
if count == 0:
  result = 0
else:
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))
 
    result = 1

  else:
    for intn in nums_int:
      result *= intn
      if result > 10**18:
        result = -1
        break
    
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = map(int, input().split())

r, p = 1, 10 ** 18
for num in A:
  r *= num
  if r == 0:
    break
  elif r > p:
    r = -1
    break
print(r)

Submission status: Wrong Answer

Solution code:
count = input()
nums_str = input().split()
nums_int = []
for strn in nums_str:
  nums_int.append(int(strn))
 
result = 1
for intn in nums_int:
  result *= intn
  if result > 10**18:
    result = -1
    break
    
print(result)

Submission status: Wrong Answer

Solution code:
count = input()
nums_str = input().split()
nums_int = []
for strn in nums_str:
  nums_int.append(int(strn))
  
result = 1
for intn in nums_int:
  result *= intn
  if result > 10**18:
    result = -1
    break
    
print(result)

Submission status: Wrong Answer

Solution code:
def main():
  n = int(input())
  k = input()
  m = k.split()
  
  if "0" in m == True:
    print(0)
    return
  
  ans = 1
  for hui in m:
    ans *= int(hui)
    
    if ans > 10**18:
        ans = -1
        break
        
  print(ans)
  
main()

Submission status: Wrong Answer

Solution code:
def main():
  n = int(input())
  k = input()
  m = k.split()
  
  if "0" in m == True:
    print(0)
    return
  
  ans = 1
  for hui in m:
    ans *= int(hui)
    
    if ans >= 10**18:
        ans = -1
        break
        
  print(ans)
  
main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a :
  s *= i
  if s > 10**18:
    print("-1")
  else:
    print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
SUM = 1
flag = 0
         
for a in A:
  SUM *= a
   
  if SUM > 10**18:
    flag = 1
    break
  elif a == 0:
    flag = 2
    break
    
if flag == 1 and A[-1]!=0:
  print(-1)
elif flag ==2 or A[-1]==0:
  print(0)
else:
  print(SUM)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
SUM = 1
flag = 0
         
for a in A:
  SUM *= a
   
  if SUM > 10**18:
    flag = 1
    break
    
if flag == 1 and A[-1]!=0:
  print(-1)
elif A[-1] == 0:
  print(0)
else:
  print(SUM)

Submission status: Wrong Answer

Solution code:
N = int(input())

nl = map(int,input().split())

ans=1
lim=10**18
flg=0

for i in nl:
  ans=ans*i
  if ans>lim:
    flg=-1
    break
    
if flg==0:
  print(ans)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(N)

nl = map(int,input().split())

ans=1
lim=10**18
flg=0

for i in nl:
  ans=ans*i
  if ans>lim:
    flg=-1
    break
    
if flg==0:
  print(ans)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(N)

nl = map(int,input().split())

ans=1
for i in nl:
  ans = ans * i

lim = 10**18

if ans > lim:
  print(-1)
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A = [int(x) for x in input().split()]

ans = np.prod(A, dtype=np.uint64)

if ans > 10**18:
    print("-1")
elif 0 in A:
    print("0")
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        sys.exit()
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int,input(). split ())

d=1

for c in a:
  if c==0:
    d=0

for b in a:
  d=b*d
  if d>(10**18):
    
    break 
    
      
      
      
if d>(10**18):
  print("-1")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10^18:
    print(-1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = 1
Flag = True
zero_flag = False
for i in range(N):
    ans = ans*A[i]
    if A[i]==0:
        zero_flag = True
        break
    if ans > 10**18:
        Flag = False
        break
        
# print(len(str(ans))-1)
if zero_flag:
    print(0)
elif ans<=10**18 or Flag:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int,input(). split ())

d=1

for b in a:
  d=b*d
  if d>(10**18):
    
    break 
    
      
      
      
if d>(10**18):
  print("-1")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = 1
Flag = True
for i in range(N):
    ans = ans*A[i]
    if ans > 10**18:
        Flag = False
        break
        
# print(len(str(ans))-1)
if ans<=10**18 or Flag:
    print(ans)
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int,input(). split ())

d=1

for b in a:
  d=b*d
  if d>=10**18:
    break 
    
      
      
      
if d>=10**18:
  print("-1")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int,input(). split ())

d=1

for b in a:
  d=b*d
  if d>10**18:
    break 
    
      
      
      
if d>10**18:
  print("-1")

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int,input(). split ())

d=1

for b in a:
  d=b*d
  if d>10**18:
    break 
    
      
      
      
if d>10**18:
  print("-1")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
N = input()
A = input().split()
if '0' in A:
    print(0)
else:
    N = int(N)
    sum = 1
    for i in range(N):
        sum *= int(A[i])
        if sum > 10**18:
            sum = -1
            exit()
    print(sum)

Submission status: Wrong Answer

Solution code:
n = input()
a = map(int,input(). split ())

d=1

for b in a:
  
  d=d*b
if d==10**18:
  print("-1")
else:
  print(d)

Submission status: Wrong Answer

Solution code:
n=input()
a = map(int,input(). split ())

d=1

for b in a:
  
  d=d*b
  
  
print(d)

Submission status: Wrong Answer

Solution code:
import numpy as np
lim=10**18

k = int(input())
a=[]
a = list(map(int, input().split()))

if 0 in a:
	print(0)
else:
	ans = np.prod(a)

	if ans > lim:
		print(-1)
	else:
		print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
lim=10**18

k = int(input())
a=[]
a = list(map(int, input().split()))

ans = np.prod(a)

if ans > lim:
	print(-1)
else:
	print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

k = int(input())
a=[]
a = list(map(int, input().split()))

ans = np.prod(a)
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

max = 10**18

n = int(input())
a = np.array([int(x) for x in input().split()])

ans = int(np.prod(a))

print(ans if ans <= max else -1)

Submission status: Wrong Answer

Solution code:
n = int(input())
num = [int(i) for i in input().split()]

q = 1

for i in num:
    q=q*i
    if i == 0:
        q=0
        break
    if q > 1e18: break

if q>1e18: print(-1)
else: print(q)

Submission status: Wrong Answer

Solution code:
def main():
    _ = input()
    a = list(map(int, input().split()))

    result = 1
    for a_i in a:
        result *= a_i

        if 10**18 < result:
            return -1
        elif result == 0:
            return 0

    return result


if __name__ == '__main__':
    result = main()
    print(result)

Submission status: Wrong Answer

Solution code:
_ = input()
a = list(map(int, input().split()))

result = 1
for a_i in a:
    result *= a_i

    if 10**18 < result:
        print(-1)
        exit(0)

print(result)
exit(0)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))

result = 1
for a_i in a:
    result *= a_i

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

Submission status: Wrong Answer

Solution code:
import numpy
n=int(input())
l=list(map(int,input().split()))
x=numpy.prod(l)
if x>1000000000000000000:
  print("-1")
else:
  print(x)

Submission status: Wrong Answer

Solution code:
import numpy
n=int(input())
l=list(map(int,input().split()))
x=[*l]
y=numpy.prod(x)
if y>1000000000000000000:
  print("-1")
else:
  print(y)

Submission status: Wrong Answer

Solution code:
import sys

N = int(input())
nums = map(int, input().split())

if 0 in nums:
  print(0)
  sys.exit(0)

ans = 1
for n in nums:
  ans *= n
  if ans > 10**18:
    print(-1)
    sys.exit(0)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = map(int, input().split())

ans = 1
for n in nums:
  
  if n == 0:
    print(0)
    break

  print(ans)
  ans *= n
  if ans > 10**18:
    print(-1)
    break

  print(ans)

Submission status: Wrong Answer

Solution code:
wfwfe=input()

b=input().split()

b=[int(p) for p in b]

count=1
for i in b:
    count=count*i

print (count)

Submission status: Wrong Answer

Solution code:
runT = 1
N=input()
LOI = input().split()
for i in range(0,int(N)-1):
    runT= runT * int(LOI[0])
    del LOI[0]
if runT<= 10**18:
    print(runT)
elif runT > 10**18:
    print(-1)

Submission status: Wrong Answer

Solution code:
def main():
    num = int(input())
    suzi = list(map(int,input().split()))
    ans = 1
    if 0 in suzi:
	    print(0)
	    return

    for kazu in suzi:
        ans *= kazu
        if ans > 1000000000000000:
            print(-1)
            return
    print(ans)


main()

Submission status: Wrong Answer

Solution code:
import numpy as np

#リスト内包表記
N = int(input())
A = [int(x) for x in input().split()]

#リストの総積を計算する
seki = np.prod(A)

#出力
if seki > 10**18:
    print("-1")
else:
    print(seki)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())

res = 1
for i in a:
  if i == 0:
    print(0)
    break
  if res > 10**18 or res == -1: res = -1
  else: res *= i

else:
  print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())

res = 1
for i in a:
  if i == 0:
    print(0)
    break
  if res > 10**18: res = -1
  else: res *= i

else:
  print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
p=1
if 0 in a:
  print(0)
else:
  for i in a:
    p*=i
    if p>10**18:
      print(-1)
      break
  if p<10**18:print(p)

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
    if x>10**18:
      print(-1)
      break
    else:
      print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
    if x>10**18:
      print(-1)
      break
  print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
    if len(str(x))>18:
      print(-1)
  print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
    if x>10**18:
      print(-1)
  print(x)

Submission status: Wrong Answer

Solution code:
#B
def unti():
    N = int(input())
    A = list(map(int, input().split()))
    result = 1
    if 0 in A:
        print(0)
        return
    for a in A:
        if result >10**18:
            print(-1)
        result *= a
    if result >10**18:
        print(-1)
    else:
        print(result)

unti()

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
A = list(map(int, input().split()))
result = 1
for i in range(len(A)):
    result *= A[i]
if result >=10**18:
    print(-1)
else:
    print(result)

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
A = list(map(int, input().split()))
result = 1
unti = True
for i in range(len(A)):
    result *= A[i]
    if result >10**18:
        print(-1)
        unti = False
if unti:
    print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
  if len(str(x))>18:
    print(-1)
  else:
    print(x)

Submission status: Wrong Answer

Solution code:
x=1
n=int(input())
a=map(int,input().split())
m=list(a)
if 0 in m:
  print(0)
else:
  for x in m:
    x*=x
  if x>10**18:
    print(-1)
  else:
    print(x)

Submission status: Wrong Answer

Solution code:
x=1
n=int(input())
a=map(int,input().split())
m=list(a)
for x in m:
  if x==0:
    print(0)
  else:
    x*=x
if x<=10**18:
  print(x)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  A = list(map(int, input().split()))
  
  if 0 in A:
    print(0)
    return
  
  prod = 1
  for el in A:
    prod *= el
    if prod > 1e18:
      print(-1)
      return
  print (prod)

Submission status: Wrong Answer

Solution code:
def fun(N,arr):
  if 0 in arr:
    print(0)
    return
  
  p = 1
  f = 1
  for i in range(N):
    p*=arr[i]
    if p>10**18:
      f = 1
      break
  if f == 1:
    print(-1)
  else:
    print(p)
  
N = int(input())
arr = list(map(int,input().split()))
fun(N,arr)

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = list(map(int,input().split()))

p = 1
flag = 0
for i in range(N):
  p*=arr[i]
  if p>10**18:
    flag = 1
    break
    
if flag==1:
  print(-1)
else:
  print(p)

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = list(map(int,input().split()))

p = 1
flag = 0
for i in range(N):
  p*=arr[i]
  if p>10**18:
    flag = 1
    break
    
if flag:
  print(-1)
else:
  print(p)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input());A = list(map(int,input().split()))

ans = 1
for i in range(N):
  ans *= A[i]
  if ans>10**18:
    print(-1);sys.exit()
    
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n = input()
l = list(map(int,input().split()))
ans = np.prod(l)
if ans > 10**18:
  print("-1")
else:
  print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int,input().split()))
a=A[0]
for i in range(1,n):
    a = a*A[i]
    if(a>10**18):
        a=-1
        break
print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
res=1
if 0 in a:
  print("0")
else:
  for x in a:
    res=res*x
    if(res>1000000000000000000):
      print("-1")
      break
  print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int,input().split()))
c = 1 
for num in a_list:
  c *= num
print(c)
if len(str(c)) >= 19:
  print(-1)
else:
  print(c)

Submission status: Wrong Answer

Solution code:
import sys
N=int(input())
a=list(map(int,input().split()))
for i in a:
  if i==0:
    print(0)
    sys.exit()
    
ans=1
for i in a:
  ans*=i
  if 1e18<ans:
    print("large")
    sys.exit()
  
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = list(map(int, input().split()))

if 0 in b:
  print(-1)
  exit()

for i in range(a):
  if i != 0:
    c = c * b[i]
  else:
    c = b[i]

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

Submission status: Wrong Answer

Solution code:
n=int(input().strip())
l=list(map(int,input().strip().split()))
result=1
for i in l:
  result*=i
if(result>=(10**18)):
  print(-1)
else:
  print(result)

Submission status: Wrong Answer

Solution code:
x = list(map(int,input().split()))

a= x[1:]
a2= x[:1]
for i in a:a2.append(a2[-1]*i)
  
print(a2[-1])

Submission status: Wrong Answer

Solution code:
n = int(input())
nums = list(map(int, input().split()))

res = 1
for i in nums:
  if i == 0:
    print(0)
    break
  else:
    res *= i
if res > 1000000000000000000:
  print(-1)
else:
  print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
nums = list(map(int, input().split()))

res = sum(nums)
if res > 1000000000000000000:
  print(-1)
else:
  print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_lst = list(map(int,input().split()))

ans = 1
for a in a_lst:
    ans *= a
    if ans > 10**18:
        ans = -1
        break
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

seki=np.prod(A)
       
if seki==0:
  print(0)
elif seki>10**18:
  print(-10)
else:
  print(seki)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(ai) for ai in input().split()]

if 0 in A:
  print(0)
else:
  ans = 1
  for ai in A:
    ans *= ai
    if ans > 10**18:
      print(-1)
      break
  
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(ai) for ai in input().split()]
ans = 1
if 0 in A:
  print(0)
else:
  for ai in A:
    ans *= ai
    if ans > 10**18:
      print(-1)
      break
  
  print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))

def main(l, n):
    x = 1
    for i in range(0, n):
        x *= l[i]
    if x <=  10^18:
        print(x)
    else:
        print(-1)

main(A, N)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

from collections import deque

N = int(input())
A = deque(list(map(int, input().split())))
ans = A.popleft()

for i in range(N - 1):
    ans *= A.popleft()
if ans >= pow(10, 18):
    print(-1)
else:
    print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))

def main(l, n):
    x = 1
    for i in range(0, n):
        x *= l[i]
    if x <=  10^18:
            print(x)
    else:
            print(-1)

main(A, N)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

from collections import deque

N = int(input())
A = deque(list(map(int, input().split())))
ans = A.popleft()

for i in range(N - 1):
    ans *= A.popleft()
    if ans >= pow(10, 18):
        print(-1)
        exit()
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
#N = int(input())
A = list(map(int,input().split()))

def main(l):
    x = np.prod(l)
    if x <=  10^18:
        print(x)
    else:
        print(-1)

main(A)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

def main(l):
    x = np.prod(l)
    if x <=  10^18:
        print(x)
    else:
        print(-1)

main(A)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]

def main(l):
    x = np.prod(l)
    if x <=  10^18:
        print(x)
    else:
        print(-1)

main(A)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A = [int(i) for i in input().split()]

def main(l):
    x = np.prod(l)
    if x <=  10^18:
        return x
    else:
        return -1

main(A)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A=[int(i) for i in input().split()]

def main(l):
    x = np.prod(l)
    if x <=  10^18:
        return x
    else:
        return -1

main(A)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
A=[int(i) for i in input().split()]

def main(l):
    x = np.prod(ｌ)
    if x <=  10^18:
        return x
    else:
        return -1

main(A)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

def main(l):
    x = np.prod(ｌ)
    if x <=  10^18:
        return x
    else:
        return -1

main(A)

Submission status: Wrong Answer

Solution code:
def main(l, n):
    x = 1
    for i in range(0, n):
        x = x*l[i]
        if x <=  10^18:
            return x
        else:
            return -1

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

def main(l, n):
    x = 1
    for i in range(0, n):
        x = x*A[i]
        if x <=  10^18:
            print(x)
        else:
            print(-1)

main(A, N)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))

def main(l, n):
    x = 1
    for i in range(0, n):
        x = x*A[i]
        if x <=  10^18:
            return x
        else:
            return -1

main(A, N)

Submission status: Wrong Answer

Solution code:
import sys
n=int(input())
a=list(map(int,input().split()))
x=1
for i in range(n):
	x *=a[i]
	if x>10**18:
		print(-1)
		sys.exit()
        
print(x)

Submission status: Wrong Answer

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

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

print(multi)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
R = 1

for a in A:
    R *= a
    if R > 10 ** 18:
        R = -1
        break
    elif a == 0:
        R = 0
        break

print(R)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
result = 1

for number in A:
  if (result > 10 ** 18):
    print(-1)
    break
  result *= number
  
if (result <= 10 ** 18):
  print(result)

Submission status: Wrong Answer

Solution code:
input()
lst = list(map(int, input().split()))
counter = 0
for a in lst:
  counter *= a
if counter > 10**18:
  print('-1')
else:
  print(counter)

Submission status: Wrong Answer

Solution code:
input()
lst = list(map(int, input().split()))
counter = 0
for a in lst:
  counter += a
if counter > 10**18:
  print('-1')
else:
  print(counter)

Submission status: Wrong Answer

Solution code:
input()
lst = list(map(int, input().split()))
counter = 0
for a in lst:
  counter *= a
if counter > 10**18:
  print('-1')
print(counter)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
nums = list(map(int, input().split()))
prod = 1
if 0 in nums:
  print(0)
else:
	for i in nums:
		prod *= i
	if prod > 10**8:
		print(-1)
	else:
		print(prod)

Submission status: Wrong Answer

Solution code:
input()
lst = list(map(int, input().split()))
counter = 0
for a in lst:
  counter += a
print(counter)

Submission status: Wrong Answer

Solution code:
import math
def main():
  n = int(input())
  nums = list(map(int, input().split()))
  if 0 in nums:
    print(0)
  elif math.prod(nums) > (10**8):
    print(-1)
  else:
    print(math.prod(nums))
main()

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
nums = list(map(int, input().split()))
if 0 in nums:
  print(0)
elif math.prod(nums) <= (10**8):
  print(math.prod(nums))
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
n = int(input())
nums = list(map(int, input().split()))
prod = 1
x = 0
if x in nums:
  print('0')
else:
  for i in nums:
    prod *= i
  if prod <= 10**8:
    print(prod)
  else:
    print('-1')

Submission status: Wrong Answer

Solution code:
str_n = input()
str_an = input()

n = int(str_n)
an = [int(ai) for ai in str_an.split()]

ans = 1
for ai in an:
  ans *= ai

if ans > 1e8:
  ans = -1
  
print(ans)

Submission status: Wrong Answer

Solution code:
str_n = input()
str_an = input()

n = int(str_n)
an = [int(ai) for ai in str_an.split()]

ans = 1
for ai in an:
  ans *= ai

if ans > 1e8:
  ans = -1
  
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))

ans = 1
for i in A:
    ans *= i

if ans > 1000000000000000000:
    print(-1)    
elif ans < 1000000000000000000:
    print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    sys.exit()

b=1
for i in range(0,N):
    b *= a[i]
    if b > 1000000000000000000:
        print(-1)
        sys.exit

print(b)

Submission status: Wrong Answer

Solution code:
import sys

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

for e in a:
    sum_a *= e
    if sum_a > 1e18:
        print(-1)
        sys.exit()

if sum_a > 1e18:
    sum_a = -1

print(sum_a)

Submission status: Wrong Answer

Solution code:
n = input()
a = list(map(int, input().split()))
sum_a = 1

for e in a:
    sum_a *= e

if sum_a > 10e18:
    sum_a = -1

print(sum_a)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
sum_a = 1

for e in a:
    sum_a *= e

if sum_a > 10e18:
    sum_a = -1

print(sum_a)

Submission status: Wrong Answer

Solution code:
N = int(input())
*A, = map(int,input().split())
max = 10**18
ans = 1

for i in range(N):
    ans *= A[i]
    if ans > max:
        print(-1)
        exit()
print(ans)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
sum_a = sum(a)
if sum_a > 10e18:
    sum_a = -1

print(sum_a)

Submission status: Wrong Answer

Solution code:
n=int(input())
ls=list(map(int,input().split()))
if 0 in ls:
	print(0)
else:
	ans=1
	for a in ls:
		ans *=a
		if ans>000000000000000000:
			ans=-1;
			break;
	print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input());
ls = list(map(int,input().split()))
ans = 1;

for i in ls:
	ans=i*ans;
	if(1000000000000000000>ans):
		ans=-1;
		break;
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input());
ls = list(map(int,input().split()))
ans = 1;
for i in ls:
	ans=i*ans;
	if(pow(10,18)>ans):
		ans=-1;
		break;
print(ans)

Submission status: Wrong Answer

Solution code:
size = int(input())

A = input()
B = []
for i in A.split():
    B.append(int(i))

mul = 1

for i in range(len(B)):
    
    mul *= B[i]
    
    if mul == 0:
        break
    elif mul > 10**18 and i == len(B):
        mul = -1
    
print(mul)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls= list(map(int, input().split()))
ans = 1
for i in ls:
  ans=i*ans
  if(ans<10**18):
    ans=-1
    break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input());
ls = list(map(int,input().split()))
ans = 1;
for i in ls:
	ans=i*ans;
	if(10**18>=ans):
		ans=-1;
		break;
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input());
ls = list(map(int,input().split()))
ans = 1;
for i in ls:
	ans=i*ans;
	if(10**18>ans):
		ans=-1;
		break;
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input());
ls=list(map(int,input().split()))
ans=1;
for i in ls:
	ans=i*ans;
if(ans<10**18):
	print(ans);
else:
	print(-1)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls= list(map(int, input().split()))
ans = 1
for i in ls:
  ans=i*ans
if(ans<10**18):
  print(ans)
else:
  print(-1)

Submission status: Wrong Answer

Solution code:
n = int(input());
ls = list(map(int,input().split()))
ans = 1;
for i in ls:
	ans=i*ans;
if(ans<10**18):
	print(ans);
else:
	print(-1)

Submission status: Wrong Answer

Solution code:
n = int(input());
ls = list(map(int,input().split()))
ans = 1;
for i in ls:
	ans=i*ans;
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np 
inf = 10**18
n = int(input())
A = list(map(int,input().split()))
S = np.prod(A)
if 0 in A:
	print(0)
elif S > inf:
	print("-1")
else:
    print(S)

Submission status: Wrong Answer

Solution code:
import numpy as np 
inf = 10**18
n = int(input())
A = list(map(int,input().split()))
S = np.prod(A)
if S > inf:
	print("-1")
else:
    print(S)

Submission status: Wrong Answer

Solution code:
from sys import stdin
MAX = 10^18

def main():
    line_count = 0

    for line in stdin:
        line_count += 1
        factors_str = line.split()
        if line_count == 2:
            break

    factors = [int(factor) for factor in factors_str]
    
    if 0 in factors:
        print(0)
        return

    product = 1
    for factor in factors:
        product *= factor
        if product > MAX:
            print(-1)
            return

    print(product)

main()

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input().split()
A = [int(a) for a in A]

MAX = 10**18
res = 1
for i in range(N):
    res *= A[i]
    if res > MAX:
        print(-1)
        break
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
A = 1
if 0 in a:
    A = 0
else: 
    for i in range(N-1):
        A = A * a[i]
        if A > 1000000000000000000:
            A = -1
        break
print(A)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
p = 10**18
a.sort()
#print(a)
if 0 in a:
    print(0)
    exit()

a.reverse()
#print(a)
ans = 1
for i in a:
    ans *= i
    #print(ans)
    if ans > p:
        print(-1)
        exit()
    else:
        print(ans)