Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a

if 10 ** 18 < total:
    total = -1

print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

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

total = 1

if 0 in li:
    total = 0
    print(total)
else:
    total = reduce(mul, li) #=> 1320
    if 10 ** 18 < total:
        total = -1
    print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Runtime Error):
n = input()
li = list(map(int, input().split())) 

total = 1

if li.index(0):
    total = 0
    print(total)
else:
    for a in li:
        total *= a
        if 10 ** 18 < total:
            total = -1
    print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split())) 

total = 1

if 0 in li:
    total = 0
    print(total)
else:
    for a in li:
        total *= a
        if 10 ** 18 < total:
            total = -1
    print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split())) 

total = 1
for a in li:
    total *= a
    if a == 0:
        total = 0
        break
    elif 10 ** 18 < total:
        total = -1


  
print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split())) 

total = 1
for a in li:
    total *= a
    if a == 0:
        total = 0
        break

if 10 ** 18 < total:
    total = -1
  
print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

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

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

total = 1
for a in li:
  total *= a
  
if math.pow(10,18) < total:
  total = -1
  
print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split())) 

total = 1
for a in li:
  total *= a
  
if 10 ** 18 < total:
  total = -1
  
print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split())) 

total = 1
for a in li:
  total *= a
  
if 10 ** 18 < total:
  total = -1
  
print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
li = list(map(int, input().split())) 

total = 1
for a in li:
  total *= a
  
if 10 ** 18 < total:
  total = -1
  
print(total)

Fixed submission:
n = input()
li = list(map(int, input().split())) 

total = 1
li.sort()
for a in li:
    if a == 0:
        total = 0
        break
    total *= a
    if 10 ** 18 < total:
        total = -1
        break
print(total)