Problem p02658 (python)

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

ans = 1

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

for i in a:
    ans *= i

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

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
 
i = [int(a) for a in input().split()]
 
if 0 in i:
  print(0)
 
for b in range(N):
  ans = ans * i[b]
 
  if ans > 10**18:
   	 ans = -1
     break
 
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
 
i = []
 
i = [int(a) for a in input().split()]

if 0 in i:
  print(0)
  break
 
	for b in range(N):
  		ans = ans * i[b]
 
  		if ans > 10**18:
   		 	ans = -1
    		break
 
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1


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

if '0' in i:
    print(0)
    return

  for b in range(N):
    ans = ans * i[b]
 
    if ans > 10**18:
      ans = -1
 
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
i = []
 
list = [i for i in input().split()]

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

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = 1
i = []
 
list = [i for i in input().split()]
 
  for a in range(N-1):
  ans = ans * i[a]
 
    if ans > 10**18:
    ans = -1
 
print(ans)

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []
 
list = [i for i in input().split()]
 
for a in range(N):
  ans = ans * i[a]
 
  if ans > 10**18:
    ans = -1
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []
 
list = [i for i in input().split()]
 
for i in range(N - 1):
  ans = ans * i
 
  if ans > 10**18:
    ans = -1
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []
 
list = [i for i in input().split()]
 
for i in range(N - 1):
  ans = ans * i
 
  if ans > 10**18:
    ans = -1
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []
 
list = [i for i in input().split()]
 
for i in range(N-1):
  ans = ans * i
 
if ans > 10**18:
    ans = "-1"
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []
a = int()
 
list = [i for i in input().split()]
 
for a in range(N-1):
  ans = ans * i[a]
 
if ans > 10**18:
    ans = "-1"
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []
 
list = [i for i in input().split()]
 
for a in range(N-1):
  ans = ans * i[a]
 
if ans > 10**18:
    ans = "-1"
 
print(str(ans))

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []

list = [i for i in input().split()]

for a in range(N-1):
  ans = ans * i[a]

if ans > 10**18:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1
i = []

list = [i for i in input().split()]

for a in range(N-1):
  ans = ans * i[a]

  if ans > 10**18:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1

list = [i for i in input().split()]

for a in range(N-1):
  ans = ans * list[a]

  if ans > 10**18:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1

list = [i for i in input().split()]

for a in range(N-1):
  ans = ans * i[a]

  if ans > 10**18:
    ans = -1

print(ans)

Buggy submission (verdict: Runtime Error):
N = input(int())
ans = 1

list = [i for i in input().split()]

for a in range(N-1):
  ans * i[a] = ans

  if ans > 10**18:
    ans = -1

print(ans)