Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
import collections


k = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in c.values():
  if i == 1:
    continue
  s += math.factorial(i) // (math.factorial(i - 2) * math.factorial(2))

for i in a:
  j = c[i] - 1
  if j <= 1:
    if j == 0:
      print(s)
      continue
    print(s - 1)
    continue
  b = math.factorial(j) // (math.factorial(j - 2) * math.factorial(2))
  y = math.factorial(j + 1) // (math.factorial(j + 1 - 2) * math.factorial(2))
  d = y - b
  print(s - d)

Fixed submission:
import collections


k = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in c.values():
  s += i * (i - 1) / 2

for i in a:
  j = c[i] - 1
  b = j * (j - 1) // 2
  y = (j + 1) * j // 2
  d = y - b
  print(int(s - d))

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


k = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in c.values():
  if i == 1:
    s += 0
    continue
  s += math.factorial(i) // (math.factorial(i - 2) * math.factorial(2))

for i in a:
  j = c[i] - 1
  if j == 1:
    print(s - 1)
    continue
  elif j == 0:
    print(s)
    continue
  b = math.factorial(j) // (math.factorial(j - 2) * math.factorial(2))
  y = math.factorial(c[i]) // (math.factorial(c[i] - 2) * math.factorial(2))
  d = y - b
  print(s - d)

Fixed submission:
import collections


k = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in c.values():
  s += i * (i - 1) / 2

for i in a:
  j = c[i] - 1
  b = j * (j - 1) // 2
  y = (j + 1) * j // 2
  d = y - b
  print(int(s - d))

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

def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


k = int(input())
a = list(map(int,input().split()))
c = collections.Counter(a)
s = 0
for i in c.values():
  if i == 1:
    s += 0
    continue
  s += combinations_count(i, 2)

for i in a:
  j = c[i] - 1
  if j == 1:
    print(s - 1)
    continue
  elif j == 0:
    print(s)
    continue
  b = combinations_count(j, 2)
  y = combinations_count(c[i], 2)
  d = y - b
  print(s - d)

Fixed submission:
import collections


k = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
s = 0
for i in c.values():
  s += i * (i - 1) / 2

for i in a:
  j = c[i] - 1
  b = j * (j - 1) // 2
  y = (j + 1) * j // 2
  d = y - b
  print(int(s - d))
Buggy python submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(l[k])

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())
print(l[k - 1])
Buggy python submission (verdict: Runtime Error):
import collections

N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
c.sort()
values, counts = zip(*c.most_common())
if len(values) == 1:
    print(values[0])
else:
    for i in range(N):
        if counts[i] == counts[0]:
            print(values[i])
        else:
            exit()

Fixed submission:
import collections

n = int(input())

res = []

for _ in range(n):
  res.append(input())

c = collections.Counter(res)
aa = c.most_common()

ss = aa[0][1]
res2 = []

aa.sort()
for i in aa:
  if i[1] == ss:
    res2.append(i[0])

for i in res2:
  print(i)

Buggy python submission (verdict: Runtime Error):
import collections
import sys

N = int(input())
S = [input() for _ in range(N)]
S.sort()
c = collections.Counter(S)
values, counts = zip(c.most_common())
if len(values) == 1:
    print(values[0])
else:
    for i in range(N):
        if counts[i] == counts[0]:
            print(values[i])
        else:
            sys.exit()

Fixed submission:
import collections

n = int(input())

res = []

for _ in range(n):
  res.append(input())

c = collections.Counter(res)
aa = c.most_common()

ss = aa[0][1]
res2 = []

aa.sort()
for i in aa:
  if i[1] == ss:
    res2.append(i[0])

for i in res2:
  print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())

dice = list(map(int, input().split()))
a = 0
b = 0

a = sum(dice[0: k])
b = sum(dice[0: k])

res = 0
ll = 0
s = 0
for i in range(k, len(dice)):
    a += dice[i]
    a -= dice[s]
    if a > b:
        b = a
        ll = i
    s += 1

for mn in range(ll - k + 1, ll + 1):
    ss = range(dice[mn] + 1)
    res += sum(ss) / dice[mn]
print(res)

Fixed submission:
n, k = map(int, input().split())
 
dice = list(map(int, input().split()))
 
a = sum(dice[0: k])
b = sum(dice[0: k])
 
res = 0
ll = 0
s = 0

for i in range(k, len(dice)):
    a += dice[i]
    a -= dice[i - k]
    if a > b:
        b = a
 
res = (b + k) /2.0
 
print(res)

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

dice = list(map(int, input().split()))
a = 0
b = 0
for j in range(k):
    a += dice[j]
    b += dice[j]
res = 0
ll = 0
s = 0
for i in range(len(dice)):
    if i < k:
        continue
    a += dice[i]
    a -= dice[s]
    if a > b:
        b = a
        ll = i
    s += 1

for mn in range(ll - k + 1, ll + 1):
    ss = range(dice[mn] + 1)
    res += sum(ss) / dice[mn]
print(res)

Fixed submission:
n, k = map(int, input().split())
 
dice = list(map(int, input().split()))
 
a = sum(dice[0: k])
b = sum(dice[0: k])
 
res = 0
ll = 0
s = 0

for i in range(k, len(dice)):
    a += dice[i]
    a -= dice[i - k]
    if a > b:
        b = a
 
res = (b + k) /2.0
 
print(res)

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

dice = list(map(int, input().split()))
a = 0
b = 0
for j in range(k):
    a += dice[j]
    b += dice[j]
res = 0
ll = 0
s = 0
for i in range(len(dice)):
    if i < k:
        continue
    a += dice[i]
    a -= dice[s]
    if a > b:
        b = a
        ll = i
    s += 1

for mn in range(ll - k + 1, ll + 1):
    ss = range(dice[mn] + 1)
    p = 1 / dice[mn]
    ex = 0
    for x in ss:
        px = p * x
        ex += px
    res += ex
print(res)

Fixed submission:
n, k = map(int, input().split())
 
dice = list(map(int, input().split()))
 
a = sum(dice[0: k])
b = sum(dice[0: k])
 
res = 0
ll = 0
s = 0

for i in range(k, len(dice)):
    a += dice[i]
    a -= dice[i - k]
    if a > b:
        b = a
 
res = (b + k) /2.0
 
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))

res = 0
aa = 0
for i in p:
    if res ==0:
        res += 1
        aa += 1
        continue
    if i <= min(p[0:aa]):
        res += 1
    aa += 1

print(res)


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

res = 0
aa = p[0]
for i in p:
     if aa >= i:
         res += 1
         aa = i

print(res)

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

res = 0
a = []
for i in p:
    a.append(i)
    if i == min(a):
        res += 1

print(res)

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

res = 0
aa = p[0]
for i in p:
     if aa >= i:
         res += 1
         aa = i

print(res)
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = input()
b = input()

res = ""
for i in range(n):
  res += a[i]
  res += b[i]
print(res)

Fixed submission:
n = int(input())

a = input().split()

res = ""
for i in range(n):
  res += a[0][i]
  res += a[1][i]
print(res)
Buggy python submission (verdict: Runtime Error):
import math

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

a = (n[0] * n[1]) // math.gcd(n[0], n[1])

print(a)

Fixed submission:
import fractions

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

a = (n[0] * n[1]) // fractions.gcd(n[0], n[1])
print(a)

Buggy python submission (verdict: Runtime Error):
import math

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

a = (n[0] * n[1]) // math.gcd(n[0], n[1])

Fixed submission:
import fractions

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

a = (n[0] * n[1]) // fractions.gcd(n[0], n[1])
print(a)

Buggy python submission (verdict: Runtime Error):
import math

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

a = (n[0] * n[1]) // math.gcd(n[0], n[1])

Fixed submission:
import fractions

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

a = (n[0] * n[1]) // fractions.gcd(n[0], n[1])
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
c = input()
cnt = 0
while 'WR' in c:
    cnt += 1
    w = c.find('W')
    r = c.rfind('R')
    c = list(c)
    c[w] = 'R'
    c[r] = 'W'
    c = ''.join(c)
print(cnt)

Fixed submission:
n = int(input())
c = input()
a = 0
b = 0
for i in range(n):
    if c[i] == 'R':
        a+=1
ans = max(a, b)
for i in range(n):
    if c[i] == 'R':
        a-=1
    else:
        b+=1
    now = max(a, b)
    ans = min(ans, now)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
# print(A)
ans = A[0]
if N >= 3:
    a = (N - 2) // 2
    b = (N - 2)  % 2
# print(a)
# print(b)
if b == 0:
    for i in range(a):
        ans += (A[i+1] * 2)
else:
    for i in range(a):
        ans += (A[i+1] * 2)
    ans += A[a+1]
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
# print(A)
ans = A[0]
if N >= 3:
    a = (N - 2) // 2
    b = (N - 2)  % 2
# print(a)
# print(b)
    if b == 0:
        for i in range(a):
            ans += (A[i+1] * 2)
    else:
        for i in range(a):
            ans += (A[i+1] * 2)
        ans += A[a+1]
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
print(A)
ans = A[0]
if N >= 3:
    a = (N - 2) // 2
    b = (N - 2)  % 2
print(a)
print(b)
if b == 0:
    for i in range(a):
        ans += (A[i+1] * 2)
else:
    for i in range(a):
        ans += (A[i+1] * 2)
    ans += A[a+1]
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
# print(A)
ans = A[0]
if N >= 3:
    a = (N - 2) // 2
    b = (N - 2)  % 2
# print(a)
# print(b)
    if b == 0:
        for i in range(a):
            ans += (A[i+1] * 2)
    else:
        for i in range(a):
            ans += (A[i+1] * 2)
        ans += A[a+1]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce

N = int(input())
A = [int(i) for i in input().split(' ')]
if 0 in A:
    print(0)
else:
    goal = reduce(mul, A)
    if goal <= 10**18:
        print(goal)
    else:
        print(-1)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(0)
else:
    answer = A[0]
    for i in range(N-1):
        answer *= A[i+1]
        if answer > 10**18:
            print(-1)
            break
    else:
        print(answer)

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

N = int(input())
A = [int(i) for i in input().split(' ')]
goal = reduce(mul, A)
if goal <= 10**18:
    print(goal)
else:
    print(-1)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(0)
else:
    answer = A[0]
    for i in range(N-1):
        answer *= A[i+1]
        if answer > 10**18:
            print(-1)
            break
    else:
        print(answer)
Buggy python submission (verdict: Runtime Error):
from sympy import prime, sieve
from collections import Counter

N = int(input())
cnt = 0
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

li = factorization(N)
a = []
for i in range(len(li)):
    a.append(li[i][1])
for i in range(len(a)):
    if 1 <= a[i] <= 2:
        cnt += 1
    elif 3 <= a[i] <= 5:
        cnt += 2
    elif 6 <= a[i] <= 9:
        cnt +=3
print(cnt)

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
n = int(input())
l = factorization(n)
ans = 0
for c in l:
    if c[0]==1:
        break
    lim = c[1]
    num = 1
    while lim >= num:
        lim -= num
        num += 1
    ans += num-1
print(ans)

Buggy python submission (verdict: Runtime Error):
from sympy import prime, sieve
from collections import Counter

# p = [i for i in sieve.primerange(0,10)]
N = int(input())
cnt = 0
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
li = prime_factorize(N)
li = [str(n) for n in li]
# print(li)
counter = Counter(li)
values, counts = zip(*counter.most_common())
# print(counts)
for i in range(len(counts)):
    if 1 <= counts[i] <= 2:
        cnt += 1
    elif 3 <= counts[i] <= 5:
        cnt += 2
    elif 6 <= counts[i] <= 9:
        cnt +=3
print(cnt)

Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
n = int(input())
l = factorization(n)
ans = 0
for c in l:
    if c[0]==1:
        break
    lim = c[1]
    num = 1
    while lim >= num:
        lim -= num
        num += 1
    ans += num-1
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, C, K = [int(i) for i in input().split(" ")]
N = [A, B, C]
# print("N:", N)
for i in N:
    K -= i
    if K == 0:
        # print("i:", i)
        # print("K:", K)
        if i == 0:
            N[i+1] = 0
            N[i+2] = 0
        elif i == 1:
            N[i+1] = 0
        break
    elif K < 0:
        # print("i:", i)
        # print("K:", K)
        if i == 0:
            N[i+1] = 0
            N[i+2] = 0
        elif i == 1:
            N[i+1] = 0
        N[i-1] += K
        break
# print("N:", N)
print(1 * N[0] -1 * N[2])

Fixed submission:
A, B, C, K = [int(i) for i in input().split(" ")]
N = [A, B, C]
for i in range(len(N)):
    K -= N[i]
    if K == 0:
        if i == 0:
            N[i+1] = 0
            N[i+2] = 0
        elif i == 1:
            N[i+1] = 0
        break
    elif K < 0:
        if i == 0:
            N[i+1] = 0
            N[i+2] = 0
        elif i == 1:
            N[i+1] = 0
        N[i] += K
        break
print(1 * N[0] -1 * N[2])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = []
for i in range(N):
    x = input()
    if x not in S:
        S.append(x)
print(len(S))

Fixed submission:
import collections

N = int(input())
S = []
for i in range(N):
    x = input()
    S.append(x)

print(len(collections.Counter(S)))
Buggy python submission (verdict: Runtime Error):
a = input().split(' ')
b = input().split(' ')
a = [int(a) for a in a]
b = [int(b) for b in b]

b.sort(reverse=True)
v = sum(b)

ans = 'Yes'

if b[a[1]-1] / v < 1 /( 4 * a[1]):
    ans = 'No'
            
print(ans)

Fixed submission:
a = input().split(' ')
s = [int(i) for i in a]
print(s[2], s[0], s[1])
Buggy python submission (verdict: Time Limit Exceeded):
a = [int(a) for a in input().split(' ')]
N = a[0]
K = a[1]
    
# def abs_met(N):
#     if N > abs(N - K):
#         N = abs(N - K)
#         abs_met(N)
#     else:
#         print(N)
        
# if K == 1:
#     print(0)
# else:
#     abs_met(N)

l = []
for i in range(N):
    if N > abs(N - K):
        N = abs(N - K)
        l.append(N)
if len(l) == 0:
    print(N)
else:
    print(min(l))

Fixed submission:
a = [int(a) for a in input().split(' ')]
N = a[0]
K = a[1]
    
def abs_met(N):
    N = N % K
    if N > abs(N - K):
        N = abs(N - K)
        abs_met(N)
    else:
        print(N)
        
if K == 1:
    print(0)
else:
    abs_met(N)

Buggy python submission (verdict: Runtime Error):
a = [int(a) for a in input().split(' ')]
N = a[0]
K = a[1]
    
def abs_met(N):
    if N > abs(N - K):
        N = abs(N - K)
        abs_met(N)
    else:
        print(N)
        
if K == 1:
    print(0)
else:
    abs_met(N)

Fixed submission:
a = [int(a) for a in input().split(' ')]
N = a[0]
K = a[1]
    
def abs_met(N):
    N = N % K
    if N > abs(N - K):
        N = abs(N - K)
        abs_met(N)
    else:
        print(N)
        
if K == 1:
    print(0)
else:
    abs_met(N)

Buggy python submission (verdict: Runtime Error):
a = [int(a) for a in input().split(' ')]
N = a[0]
K = a[1]
    
def abs_met(N):
    if N > abs(N - K):
        N = abs(N - K)
        abs_met(N)
    else:
        print(N)
        
if K == 1:
    print(0)
else:
    abs_met(N)

Fixed submission:
a = [int(a) for a in input().split(' ')]
N = a[0]
K = a[1]
    
def abs_met(N):
    N = N % K
    if N > abs(N - K):
        N = abs(N - K)
        abs_met(N)
    else:
        print(N)
        
if K == 1:
    print(0)
else:
    abs_met(N)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
li = [0]*10**5
for i in range(N):
    li[A[i]] += 1
# print(li)
li.sort(reverse=True)
# print(li)
print(sum(li[K:]))

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
li = [0]*10**6
for i in range(N):
    li[A[i]] += 1
# print(li)
li.sort(reverse=True)
# print(li)
print(sum(li[K:]))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
li = [0]*10
for i in range(N):
    li[A[i]] += 1
li.sort(reverse=True)
print(sum(li[K:]))

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
li = [0]*10**6
for i in range(N):
    li[A[i]] += 1
# print(li)
li.sort(reverse=True)
# print(li)
print(sum(li[K:]))
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

s = input()
K = int(s)

if ((K & 1 == 0) or (int(s[-1]) % 5 == 0)):
  print(-1)

if K % 7 == 0:
  L = 9 * K / 7
else:
  L = 9 * K

i = 1
r = 10
while True:
  r = r % L
  if r == 1:
    print(i)
    break
  r *= 10
  i += 1

Fixed submission:
s = input()
K = int(s)

if ((K & 1 == 0) or (s[-1] == "5")):
  print(-1)
else:
  if K % 7 == 0:
    L = 9 * K / 7
  else:
    L = 9 * K

  i = 1
  r = 10
  while True:
    r = r % L
    if r == 1:
      print(i)
      break
    r *= 10
    i += 1
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations

N, K = [int(x) for x in input().split()]
prices = [int(x) for x in input().split()]

min_value = 1000 * 1000
for x in combinations(prices, K):
  min_value = min(min_value, sum(x))

print(min_value)

Fixed submission:
N, K = [int(x) for x in input().split()]
prices = sorted([int(x) for x in input().split()])

print(sum(prices[:K]))
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
A = [int(x) for x in input().split()]
d = Counter(A)
Q = int(input())

def sum_from_counter(d):
  return sum(map(lambda k: k * d[k], d))

for i in range(Q):
  B, C = [int(x) for x in input().split()]
  d[C] = d.get(C, 0) + d[B]
  del d[B]
  print(sum_from_counter(d))

Fixed submission:
from collections import Counter

N = int(input())
A = [int(x) for x in input().split()]
d = Counter(A)
Q = int(input())

def sum_from_counter(d):
  return sum(map(lambda k: k * d[k], d))

s = sum(map(lambda k: k * d[k], d))
for i in range(Q):
  B, C = [int(x) for x in input().split()]
  d[C] = d.get(C, 0) + d[B]
  s += (C - B) * d[B]
  d[B] = 0
  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce

def problem():
  N = int(input())
  xs = [int(x) for x in input().split()]

  for i in range(N):
    t = (x for j, x in enumerate(xs) if i != j)
    yield reduce(lambda acc, elem: acc ^ elem, t)

print(*problem())

Fixed submission:
from functools import reduce

def problem():
  N = int(input())
  xs = [int(x) for x in input().split()]
  t = reduce(lambda acc, elem: acc ^ elem, xs)

  for i in range(N):
    yield (t ^ xs[i])

print(*problem())

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

N = int(input())
xs = [int(x) for x in input().split()]

def others_xor(l, i):
  l.pop(i)
  return reduce(lambda acc, elem: acc ^ elem, l)

print(*[others_xor(xs[::], i) for i in range(N)])

Fixed submission:
from functools import reduce

def problem():
  N = int(input())
  xs = [int(x) for x in input().split()]
  t = reduce(lambda acc, elem: acc ^ elem, xs)

  for i in range(N):
    yield (t ^ xs[i])

print(*problem())
Buggy python submission (verdict: Time Limit Exceeded):
s = 1

N = input()
for x in input().split():
  s *= int(x)

if s > 10 ** 18:
  print(-1)
else:
  print(s)

Fixed submission:
N = input()
xs = [int(x) for x in input().split()]

if 0 in xs:
  print(0)
else:
  s = 1
  for x in xs:
    s *= x
    if s > 10 ** 18:
      print(-1)
      break
  else:
    print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
numList = list(map(int, input().split()))

count = 0
for i in range(1, n + 1):
  if min(numList[:i]) == numList[i-1]:
    count += 1
print(count)

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

count = 0
minNum = 10 ** 6
for i in range(1, n + 1):
  if minNum > numList[i-1]:
    minNum = numList[i-1]
    count += 1
print(count)