Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

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

ans = 1
max = 1000000000000000000
for i in range(len(N)):
  ans = ans * N[i]

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

Fixed submission:
import sys
input = sys.stdin.readline

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

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

Buggy python submission (verdict: Time Limit Exceeded):
A = input()
N = input().split()
N = [int(s) for s in N]
 
ans = 1
max = 1000000000000000000
for i in range(len(N)):
  ans = ans * N[i]
 
if ans > max:
  print(-1)
else:
  print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

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

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

Buggy python submission (verdict: Time Limit Exceeded):
A = input()
N = input().split()
N = [int(s) for s in N]

ans = 1
max = 1000000000000000000
for i in range(len(N)):
  ans = ans * N[i]

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

Fixed submission:
import sys
input = sys.stdin.readline

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

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

Buggy python submission (verdict: Time Limit Exceeded):
A = input()
N = input().split()
N = [int(s) for s in N]

ans = 1
max = 1000000000000000000
for i in range(len(N)):
  ans = ans * N[i]

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

Fixed submission:
import sys
input = sys.stdin.readline

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

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

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=1000000000000000000

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
        if multi_sum > LIMIT:
            multi_sum=-1
else:
    multi_sum=0

print(multi_sum)


Fixed submission:
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=1000000000000000000

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
        if multi_sum > LIMIT:
            multi_sum=-1
            break
else:
    multi_sum=0

print(multi_sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=1000000000000000000

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
    if multi_sum > LIMIT:
        multi_sum=-1
else:
    multi_sum=0

print(multi_sum)



Fixed submission:
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=1000000000000000000

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
        if multi_sum > LIMIT:
            multi_sum=-1
            break
else:
    multi_sum=0

print(multi_sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=10**18

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
else:
    multi_sum=0
if multi_sum > LIMIT:
    multi_sum=-1
print(multi_sum)



Fixed submission:
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=1000000000000000000

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
        if multi_sum > LIMIT:
            multi_sum=-1
            break
else:
    multi_sum=0

print(multi_sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=10**18
for a_i in a_list:
    multi_sum*=a_i

if multi_sum > LIMIT:
    multi_sum=-1
print(multi_sum)



Fixed submission:
n=int(input())
a_list=list(map(int, input().split()))
multi_sum=1
LIMIT=1000000000000000000

if 0 not in a_list:
    for a_i in a_list:
        multi_sum*=a_i
        if multi_sum > LIMIT:
            multi_sum=-1
            break
else:
    multi_sum=0

print(multi_sum)