Buggy python submission (verdict: Runtime Error):
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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

Fixed submission:
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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

Buggy python submission (verdict: Runtime Error):
#from operator import mul
#from functools import reduce
cnt = 1000000000000000000
ans =1
N = map(int, input().split())
nums = list(map(int, input().split()))


count  = reduce(mul, nums)
if "0" in N:
        print("0")
for  num in nums
    ans *= num
        if count  > cnt :
        print(-1)

print(count)


Fixed submission:
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
cnt = 1000000000000000000
N = map(int, input().split())
nums = list(map(int, input().split()))


count  = reduce(mul, nums)
if "0" in N:
        print("0")
elif count  > cnt :
        print(-1)
else:
         print(count)


Fixed submission:
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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

Buggy python submission (verdict: Runtime Error):
#include<stdio.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define cnt 1000000000000000000
int main(){
  int N;
  long int A[1000000];
  long long int sum=1;
  scanf("%d", &N);
  for (int i = 0; i <N; i++){
    scanf("%ld",&A[i]);
    sum *= A[i];

  }

  
  if(sum >cnt){
    printf("-1\n");
  }else{
    printf("%lld\n", sum);
  }
  return 0;
}

Fixed submission:
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
cnt = 1000000000000000000
N = map(int, input().split())
nums = list(map(int, input().split()))


count  = reduce(mul, nums)
if count  > cnt :
        print(-1)
else:
         print(count)

Fixed submission:
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
cnt = 10 **18
N = map(int, input().split())
nums = list(map(int, input().split()))


count  = reduce(mul, nums)
if count  > cnt :
        print(-1)
else:
         print(count)

Fixed submission:
#from operator import mul
#from functools import reduce
#cnt = 1000000000000000000
ans =1
N = int(input())
nums = list(map(int, input().split()))

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