Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p_list = list(map(int, input().split()))
ans = 1
for i in range(1, n):
    if all([p_list[i] <= p_list[j] for j in range(i)]):
        ans += 1
print(ans)


Fixed submission:
n = int(input())
p_list = list(map(int, input().split()))
ans = 1
min = p_list[0]
for i in range(1, n):
    if min >= p_list[i]:
        ans += 1
        min = p_list[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
print(f"{a - k} {b}" if a >= k else f"{0} {b - (k - a)}")

Fixed submission:
a, b, k = map(int, input().split())
print("{} {}".format(a - k, b) if a >= k else "{} {}".format(0, max(0, b - (k - a))))

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
print(f"{a - k} {b}" if a >= k else f"0 {b - (k - a)}")

Fixed submission:
a, b, k = map(int, input().split())
print("{} {}".format(a - k, b) if a >= k else "{} {}".format(0, max(0, b - (k - a))))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t_list = input()
pre_list = []
towin = {"r": "p", "s": "r", "p": "s"}
topoint = {"r": r, "s": s, "p": p}
pre = {}
if s >= p:
    pre["r"] = "s"
else:
    pre["r"] = "p"
if s >= r:
    pre["s"] = "r"
else:
    pre["s"] = "p"
if r >= s:
    pre["p"] = "r"
else:
    pre["p"] = "s"
ans = 0
for i in range(n):
    win_hand = towin[t_list[i]]
    if i < k:
       ans += topoint[win_hand]
       pre_list.append(win_hand)
    else:
        if win_hand == pre_list[i - k]:
            if i <= n - k:
                hand = pre[t_list[i + k]]
                pre_list.append(hand)
        else:
            ans += topoint[win_hand]
            pre_list.append(win_hand)
print(ans)

Fixed submission:
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t_list = list(input())
towin = {"r": p, "s": r, "p": s}
ans = 0
for i in range(n):
    if i < k:
        ans += towin[t_list[i]]
    else:
        if t_list[i - k] == t_list[i]:
            t_list[i] = "-1"
        else:
            ans += towin[t_list[i]]
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
a, b = list(map(int, input().split()))
print(a * b // np.gcd(a, b))

Fixed submission:
import fractions
a, b = list(map(int, input().split()))
print(a * b // fractions.gcd(a, b))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_list = list(map(int, input().split()))

num = 1
pos = 0
count = 0

while pos < len(a_list):
    if num != a_list[pos]:
        del a_list[pos]
        count += 1
    else:
        num += 1
        pos += 1

if len(a_list) == 0:
    print(-1)
else:
    print(count)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))
ans = 0
wait_for = 1
for a in a_list:
    if a == wait_for:
        wait_for += 1
    else:
        ans += 1
if wait_for == 1:
    print(-1)
else:
    print(ans)

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

num = 1
pos = 0
count = 0

while pos < len(a_list):
    if num != a_list[pos]:
        del a_list[pos]
        count += 1
    else:
        num += 1
        pos += 1

if len(a_list) == 0:
    print(-1)
else:
    print(count)

Fixed submission:
n = int(input())
a_list = list(map(int, input().split()))
ans = 0
wait_for = 1
for a in a_list:
    if a == wait_for:
        wait_for += 1
    else:
        ans += 1
if wait_for == 1:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    for n in range(int(N ** (1 / 2)))[::-1]:
        if N % n == 0:
            print(n - 1 + N // n - 1)
            return
main()

Fixed submission:
def main():
    N = int(input())
    for n in range(int(N ** (1 / 2)) + 1)[::-1]:
        if N % n == 0:
            print(n - 1 + N // n - 1)
            return
main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())

i = 1
nowcolor = s[0]
while(True):
    if nowcolor == s[i]:
        del s[i]
    else:
        nowcolor = s[i]
        i += 1
    if len(s) == i:
        break
print(len(s))

Fixed submission:
n = int(input())
s = list(input())

ans_list = [s[0]]
now_color = s[0]
for i in range(1, n):
    if now_color != s[i]:
        ans_list.append(s[i])
        now_color = s[i]
    # print("s[{}]:{} now_color:{} ans_list:{}".format(i, s[i], now_color, ans_list))

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

ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if li[i] < li[j] + li[k] and li[j] < li[k] + li[i] and li[k] < li[i] + li[j]:
                # print(li[i], li[j], li[k])
                ans += 1

print(ans)


Fixed submission:
import bisect
n = int(input())
li = sorted(list(map(int, input().split())))
ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        ans += bisect.bisect_left(li, li[i] + li[j]) - j - 1
print(ans)

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

ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if li[i] < li[j] + li[k] and li[j] < li[k] + li[i] and li[k] < li[i] + li[j]:
                # print(li[i], li[j], li[k])
                ans += 1

print(ans)


Fixed submission:
import bisect
n = int(input())
li = sorted(list(map(int, input().split())))
ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        ans += bisect.bisect_left(li, li[i] + li[j]) - j - 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n,k,q = map(int,input().split())
alist = [int(input()) for i in range(q)]

"""
atuple = tuple(alist)

acount = collections.Counter(atuple)
print(acount,q,k)
tlist = []
for key,v in acount.items():
    if q - v < k:
        tlist.append(key)
"""

for i in range(1,n+1):
    if q - alist.count(i) < k:
        print("Yes")
    else:
        print("No")
        

Fixed submission:
import collections
n,k,q = map(int,input().split())
alist = [int(input()) for i in range(q)]

atuple = tuple(alist)

acount = collections.Counter(atuple)
#print(acount,q,k)

for i in range(1,n+1):
    if q - acount[i] < k:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
Clist = list(map(int, input().split()))

manzokudo = 0
for B in Blist:
    manzokudo += B
    
for i in range(len(Alist) - 1):
    if Alist[i]+1 == Alist[i+1]:
        manzokudo += Clist[i+1]

print(manzokudo)

Fixed submission:
N = int(input())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
Clist = list(map(int, input().split()))

manzokudo = 0
for B in Blist:
    manzokudo += B
    
for i in range(0, N-1):
    if Alist[i]+1 == Alist[i+1]:
        manzokudo += Clist[Alist[i]-1]

print(manzokudo)
Buggy python submission (verdict: Time Limit Exceeded):
print(sum(range(1, int(input()))))

Fixed submission:
n = int(input())
print((n - 1) * n // 2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
slist = []
ans = 0

sdic = {}
for i in range(n):
    s = str(sorted(list(input())))
    if s in sdic.keys():
        ans += sdic[s]
        sdic[s] += 1
    else:
        sdic[s] = 1

print(ans)

Fixed submission:
import collections
n = int(input())
s_list = ["".join(sorted(input())) for _ in range(n)]
s_dict = {}
ans = 0
for s in s_list:
    if s in s_dict:
       ans += s_dict[s]
       s_dict[s] += 1
    else:
        s_dict[s] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))

ans = "Yes"
for i in range(n-1):
    if h[i] - h[i + 1] >= 2:
        ans = "No"
        break;
    elif h[i] - h[i + 1] == 1:
        h[i] -= 1

for i in range(n-1):
    if h[i] > h[i + 1]:
        ans = "No" 

print(ans))

Fixed submission:
def main():
    n = int(input())
    h_list = list(map(int, input().split()))
    for i in range(n - 1)[::-1]:
        if h_list[i] == h_list[i + 1] + 1:
            h_list[i] = h_list[i] - 1
        elif h_list[i] > h_list[i + 1] + 1:
            print("No")
            return
    print("Yes")

main()
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())
if l - r >= 2019:
    print(0)
else:
    mi = 10 ** 4
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            mi = min((i * j) % 2019, mi)
    print(mi)

Fixed submission:
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
else:
    mi = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            mi = min((i * j) % 2019, mi)
    print(mi)

Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())
if l - r >= 2019:
    print(0)
else:
    min = 10 ** 4
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            tmp = (i * j) % 2019
            if tmp < min:
                min = tmp
    print(min)

Fixed submission:
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
else:
    mi = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            mi = min((i * j) % 2019, mi)
    print(mi)

Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())
if l - r >= 2019:
    print(0)
else:
    min = 10 ** 4
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            tmp = (i * j) % 2019
            if tmp < min:
                min = tmp
    print(min)

Fixed submission:
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
else:
    mi = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            mi = min((i * j) % 2019, mi)
    print(mi)
Buggy python submission (verdict: Runtime Error):
n, q = map(int, input().split())
s_list = list(input())
l_r_list = [list(map(int, input().split())) for _ in range(q)]
c_sum= [0]
su = 0
for i in range(n):
    if s_list[i] == "A" and s_list[i + 1] == "C":
        su += 1
    c_sum.append(su)
for l, r in l_r_list:
    print(c_sum[r - 1] - c_sum[l - 1])

Fixed submission:
n, q = map(int, input().split())
s_list = list(input())
l_r_list = [list(map(int, input().split())) for _ in range(q)]
c_sum = [0]
su = 0
for i in range(n - 1):
    if s_list[i] == "A" and s_list[i + 1] == "C":
        su += 1
    c_sum.append(su)
for l, r in l_r_list:
    print(c_sum[r - 1] - c_sum[l - 1])
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h_list = list(map(int, input().split()))
dp = [0]
for i in range(1, n):
    mi = min([abs(h_list[i] - h_list[j]) + dp[j] for j in range(max(0, i - k), i)])
    dp.append(mi)
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h_list = list(map(int, input().split()))
dp = [0]
for i in range(1, n):
    mi = min([abs(h_list[i] - h_list[j]) + dp[j] for j in range(max(0, i - k), i)])
    dp.append(mi)
print(dp[-1])
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    
    out = 1
    for n in A:
        out = n * out
    
    if out > 1000000000000000000:
        print(-1)
    else:
        print(out)



main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    if 0 in A:
        print(0)
    else:
        out = 1
        for n in A:
            out = n * out
            if out > 1000000000000000000:
                break
            else:
                continue
    
        if out > 1000000000000000000:
            print(-1)
        else:
            print(out)


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    A = [int(x) for x in input().split()]
    
    out = 1
    for n in A:
        out = n * out
    
    if out > 1000000000000000000:
        print(-1)
    else:
        print(out)



main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())
    A = [int(x) for x in input().split()]

    if 0 in A:
        print(0)
    else:
        out = 1
        for n in A:
            out = n * out
            if out > 1000000000000000000:
                break
            else:
                continue
    
        if out > 1000000000000000000:
            print(-1)
        else:
            print(out)


main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def main():
    N = list(map(int, open(0).read().split()))
    N = N[0]
    L = 0

    for a in range(1, N+1):
        for b in range(1, N+1):
            for c in range(1, N+1):
                L += gcd(a,b,c)
    print(L)
main()

Fixed submission:
#!/usr/bin/env python3
import math
from functools import reduce
 
def gcd(*numbers):
    return reduce(math.gcd, numbers)
 
def main():
    N = list(map(int, open(0).read().split()))
    N = N[0]
    L = 0
 
    for a in range(1, N+1):
        for b in range(1, N+1):
            for c in range(1, N+1):
                L += gcd(a,b,c)
    print(L)
main()
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())

if (N % K == 0):
  print('0')
else:
  while N > abs(N - K):
    N = abs(N - K)
      
  print(N)

Fixed submission:
N, K = map(int, input().split())

E = N % K

if (E == 0):
  print('0')
else:
  if E < abs(E - K):
    print(E)
  else:
    print(abs(E - K))
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    A, B = map(int, open(0).read().split())

    ans_A = []
    for i in range(int(12.5 * A), int(12.5 * A + 12.5 + 1)):
        ans_A.append(i)
    ans_B = []
    for i in range(int(10*B), int(10*B + 10 + 1)):
        ans_B.append(i)
    ans = set(ans_A) & set(ans_B)
    if len(ans) == 0:
        print(-1)
    else:
        print(min(list(ans)))


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    *S, = map(str, open(0).read().split())
    S = S[0]
    if (S == "AAA" or S == "BBB"):
        print("No")
    else:
        print("Yes")


main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    *P, = map(int, input().split())

    cnt = 0
    for i in range(0, N):
        if P[i] == min(P[0:i + 1]):
            cnt += 1
    print(cnt)


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())
    *P, = map(int, input().split())

    mini = 10**6
    cnt = 0
    for _ in P:
        if _ < mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    *a, = map(int, input().split())

    max_i = 0
    for i in range(1, max(a) + 1):
        if i in a:
            ind = a.index(i)
            if ind >= 0:
                a = a[ind:]
                max_i = i
            else:
                break
        else:
            break
        
    if max_i == 0:
        print(-1)
    elif max_i == N:
        print(0)
    else:
        print(N - max_i)


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())
    *a, = map(int, input().split())

    n = 1
    s = 0

    for _ in a:
        if _ == n:
            n += 1
        else:
            s += 1
    if n == 1:
        print(-1)
    else:
        print(s)


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    *a, = map(int, input().split())

    max_i = 0
    for i in range(1, max(a) + 1):
        if i in a:
            ind = a.index(i)
            if ind >= 0:
                a = a[ind:]
                max_i = i
            else:
                break
        else:
            break
        
    if max_i == 0:
        print(-1)
    elif max_i == N:
        print(0)
    else:
        print(N - max_i)


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N = int(input())
    *a, = map(int, input().split())

    n = 1
    s = 0

    for _ in a:
        if _ == n:
            n += 1
        else:
            s += 1
    if n == 1:
        print(-1)
    else:
        print(s)


main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    Card = [[] for i in range(M)]
    Diff = [i for i in range(1, N + 1)]

    for i in range(0, M):
        L, R = map(int, input().split())
        tmp = []
        for j in range(L, R + 1):
            if j in Diff:
                tmp.append(j)
        Diff = tmp
    print(len(Diff))    


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    L =[0 for i in range(M)]
    R = [0 for i in range(M)]

    for i in range(0, M):
        L[i], R[i] = map(int, input().split())
    
    print(max(min(R) - max(L) + 1, 0))


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    Card = [[] for i in range(M)]
    Diff = [i for i in range(1, N + 1)]

    for i in range(0, M):
        L, R = map(int, input().split())
        for j in range(L, R + 1):
            Card[i].append(j)
        Diff = list(set(Diff) & set(Card[i]))
    print(len(Diff))


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    L =[0 for i in range(M)]
    R = [0 for i in range(M)]

    for i in range(0, M):
        L[i], R[i] = map(int, input().split())
    
    print(max(min(R) - max(L) + 1, 0))


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    Diff = [i for i in range(1, N + 1)]

    for i in range(0, M):
        L, R = map(int, input().split())
        Card = []
        for j in range(L, R + 1):
            Card.append(j)
        Diff = list(set(Diff) & set(Card))
    print(len(Diff))


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    L =[0 for i in range(M)]
    R = [0 for i in range(M)]

    for i in range(0, M):
        L[i], R[i] = map(int, input().split())
    
    print(max(min(R) - max(L) + 1, 0))


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    Card = [[] for i in range(M)]
    Diff = [i for i in range(1, N + 1)]

    for i in range(0, M):
        L, R = map(int, input().split())
        for j in range(L, R + 1):
            Card[i].append(j)
        Diff = list(set(Diff) & set(Card[i]))
    print(len(Diff))


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    N, M = map(int, input().split())
    L =[0 for i in range(M)]
    R = [0 for i in range(M)]

    for i in range(0, M):
        L[i], R[i] = map(int, input().split())
    
    print(max(min(R) - max(L) + 1, 0))


main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    D = [[] for i in range(0, N)]
    for i in range(0, N):
        for j in range(0, N):
            D[i].append(abs(h[i] - h[j]))
        D[i].sort()
    S = []
    for i in range(0, N):
        S.append(sum(D[i][0:K]))

    print(min(S))


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    h.sort(reverse=True)
    ans = max(h) - min(h)
    for i in range(0, N - K + 1):
        d = h[i] - h[i + K -1]
        if d < ans:
            ans = d
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    D = [[] for i in range(0, N)]
    for i in range(0, N):
        for j in range(0, N):
            if not i == j:
                D[i].append(abs(h[i] - h[j]))
        D[i].sort()
    S = []
    for i in range(0, N):
        S.append(sum(D[i][0:K - 1]))

    print(min(S))


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    h.sort(reverse=True)
    ans = max(h) - min(h)
    for i in range(0, N - K + 1):
        d = h[i] - h[i + K -1]
        if d < ans:
            ans = d
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    D = [[] for i in range(0, N)]
    for i in range(0, N):
        for j in range(0, N):
            if not i == j:
                D[i].append(abs(h[i] - h[j]))
        D[i].sort()

    ans = max(h) - min(h)
    for i in range(0, N):
        tmp = sum(D[i][0:K - 1])
        if tmp < ans:
            ans = tmp

    print(ans)


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    h.sort(reverse=True)
    ans = max(h) - min(h)
    for i in range(0, N - K + 1):
        d = h[i] - h[i + K -1]
        if d < ans:
            ans = d
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    D = [[] for i in range(0, N)]
    for i in range(0, N):
        for j in range(0, N):
            if not i == j:
                D[i].append(abs(h[i] - h[j]))
        D[i].sort()

    ans = max(h) - min(h)
    for i in range(0, N):
        tmp = sum(D[i][0:K - 1])
        if tmp < ans:
            ans = tmp

    print(ans)


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    h = N[2:]
    K = N[1]
    N = N[0]

    h.sort(reverse=True)
    ans = max(h) - min(h)
    for i in range(0, N - K + 1):
        d = h[i] - h[i + K -1]
        if d < ans:
            ans = d
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    A = N[1:]
    N = N[0]

    cnt = 0
    for i in A:
        if i % 2 == 0:
            for j in range(0, max(A)):
                i = i//2
                cnt = cnt + 1
                if (i < 2) or not (i % 2 == 0):
                    break
    print(cnt)


main()

Fixed submission:
#!/usr/bin/env python3

def main():
    *N, = map(int, open(0).read().split())
    A = N[1:]
    N = N[0]

    cnt = 0
    for i in A:
        if i % 2 == 0:
            for j in range(0, max(A)):
                i = i//2
                cnt = cnt + 1
                if (i < 2) or not (i % 2 == 0):
                    break
    print(cnt)


main()