Buggy python submission (verdict: Time Limit Exceeded):
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
        if sum > 1000000000000000000:
                print(-1)
                exit()
        else:
            print(sum)
    
if __name__ == '__main__':
    main()
   


Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    for i in a:
        k = copy.deepcopy(sum)
        sum = k * i
    if sum - 1000000000000000000 > 0:
        print(-1)
    else:
       print(sum)
    
if __name__ == '__main__':
    main()
   

Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    for i in a:
        sum *= i
    if sum - 1000000000000000000 > 0:
        print(-1)
    else:
       print(sum)
    
if __name__ == '__main__':
    main()

Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    for i in a:
        sum *= i
    if sum >1000000000000000000:
        print(-1)
    else:
       print(sum)
    
if __name__ == '__main__':
    main()

Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    for i in a:
        sum = sum * i
    if sum >1000000000000000000:
        print(-1)
    else:
       print(sum)
    
if __name__ == '__main__':
    main()


Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    for i in a:
        sum = sum * i
    if np.log10(sum) >= 18:
        print(-1)
    else:
       print(sum)
    
if __name__ == '__main__':
    main()

Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    for i in a:
        sum = sum * i
    if sum >1000000000000000000:
        print(-1)
    else:
       print(sum)
    
if __name__ == '__main__':
    main()

Fixed submission:
import copy

def main():
    n = int(input())
    a = list( map( int, input().split()))
    sum = 1
    if 0 in a:
        print(0)
    else:
        for i in a:
            sum = sum * i
            if sum > 1000000000000000000:
                print(-1)
                exit()
        print(sum)
    
if __name__ == '__main__':
    main()