Problem p02658 (python)

Fixed submission:
import sys  # sys.exit()を使いたいので

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

if 0 in a:
# 0が1つでもあれば0です
    print(0)
else:
# 0がない場合
    cur = 1  # 現在の数値
    for x in a:
        cur *= x
        if cur > 10 ** 18:
        # 10**18を超えたので終了します
            print(-1)
            sys.exit()
    print(cur)  # 10**18以下なので、出力します

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

if 0 in A:
    print(0)
    exit(0)
ans = 1
for i in range(N):
　 ans = ans*A[i]
   if 10**18 < ans:
    print(-1)    
    exit(0)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
import sys

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

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    sus.exit()
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)

ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)
    
ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
if 10**18 < ans:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)
    
ans = np.prod(A)
if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
if 0 in A:
    print(0)
    exit(0)
    
ans = np.prod(A)
elif ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if 0 in A:
    print(0)
    exit(0)
elif ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if 0 in A:
    print(0)
    exit(0)
if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if 0 in A:
    print(0)
    exit(0)
if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
import numpy as np
ans = np.prod(A)

if 0 in A:
    print(ans)
    exit(0)
if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
import numpy as np
ans = np.prod(A)

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

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

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

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

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)

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

if ans<= 10**18:
    print(ans)
    exit(0)
else:
    print(-1)