Problem p02658 (python)

Fixed submission:
n = int(input())
b = 1
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    for i in range(n):
        b *= a[i]
        if b > 10**18:
            print(-1)
            break
    if b <=10**18:
        print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
b = 1
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    for i in range(n):
        b *= int(a[i])
    b *= a[n]
    if b > 10**18:
       print(-1)
    else:print(b)

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

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

Buggy submission (verdict: Runtime Error):
n = input()
b = 1
a = list(map(str,input().split()))
if "0" in a:
    print(0)
else:
    for i in range(int(a)):
        b *= int(a[i])
    if b > 10**18:
        print(-1)
    else:
        print(b)

Buggy submission (verdict: Runtime Error):
n = input()
b = 1
a = list(map(str,input().split()))
if "0" in a:
    print(0)
else:
    for a in range(int(a)):
        b *= int(a[0])
    if b > 10**18:
        print(-1)
    else:
        print(b)

Buggy submission (verdict: Runtime Error):
n = input()
b = 1
a = list(map(str,input().split()))
if 0 in a:
    print(0)
else:
    for a in range(int(a)):
        b *= a[0]
    if b > 10**18:
        print(-1)
    else:
        print(b)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = map(int,input().split())
kakekake = kakeru[0]
    if n > 2:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i-1]
    elif n==2:
    kakekake = kakeru[0] * kakeru[1]
if kakekake > 100000000000000000000:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = map(int,input().split())
kakekake = kakeru[0]
    if n > 2:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i-1]
    elif n==2:
    kakekake = kakeru[0] * kakeru[1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 2:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i-1]
    elif n==2:
    kakekake = kakeru[0] * kakeru[1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 2:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i-1]
    elif n==2:
    kakekake = kakeru[0] + kakeru[1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 1:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i]
if kakekake > 10:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 1:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 2:
        for i in range(2,n+1):
            kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 4:
        for i in range(n-3):
            kakekake = kakekake * kakeru[i+1]
    elif n == 2:
        kakekake = kakeru[0] + kakeru[1]
    elif n == 3:
        kakekake = kakeru[0] + kakeru[1] + kakeru[2]
    elif n == 4:
        kakekake = kakeru[0] + kakeru[1] + kakeru[2] + kakeru[3]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 3:
        for i in range(n-3):
            kakekake = kakekake * kakeru[i+1]
    elif n == 2:
        kakekake = kakeru[0] + kakeru[1]
    elif n == 3:
        kakekake = kakeru[0] + kakeru[1] + kakeru[2]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 1:
        for i in range(n-3):
            kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 2:
        for i in range(n-2):
            kakekake = kakekake #* kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = input().split()
kakekake = kakeru[0]
    if n > 2:
        for i in range(n-2):
            kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = map(int, input().split())
kakekake = kakeru[0]
    if n > 2:
        for i in range(n-2):
            kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = map(int, input().split())
kakekake = kakeru[0]
    for i in range(n-2):
        kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = list(map(int, input().split()))
kakekake = kakeru[0]
    for i in range(n-2):
        kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)

Buggy submission (verdict: Runtime Error):
n = input()
kakeru = list(map(int, input().split()))
kakekake = kakeru[0]
    for i in range(n-1):
        kakekake = kakekake * kakeru[i+1]
if kakekake > 10**18:
    print(-1)
print(kakekake)