Buggy python submission (verdict: Time Limit Exceeded):
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 1
    for i in inlis:
        ans *= i
        #print(ans)
    if ans > 10 ** 18:
        ans = -1
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
    for i in inlis:
        ans *= i
        #print(ans)
        if ans > 10 ** 18:
            ans = -1
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    import functools
    import operator
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = functools.reduce(operator.mul, inlis)
    if ans > 10 ** 18:
        ans = -1
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    inlis = tuple(map(int, input().split()))
    ans = 1
    for i in inlis:
        ans *= i
    if ans > 10 ** 18:
        ans = -1
    print(ans)
    



if __name__ == "__main__":
    main()


Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 1
    for i in inlis:
        ans *= i
        #print(ans)
    if ans > 10 ** 18:
        ans = -1
    print(ans)
    



if __name__ == "__main__":
    main()

Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    inlis = list(map(int, input().split()))
    ans = 1
    for i in inlis:
        ans *= i
        #print(ans)
    if ans > 10 ** 18:
        ans = -1
    print(ans)
    



if __name__ == "__main__":
    main()

Fixed submission:
def main():
    from sys import stdin
    input = stdin.readline
    n = int(input())
    inlis = list(map(int, input().split()))
    if 0 in inlis:
        ans = 0
    else:
        ans = 1
        for i in inlis:
            ans *= i
            #print(ans)
            if ans > 10 ** 18:
                ans = -1
                break
    print(ans)
    
 
 
 
if __name__ == "__main__":
    main()