Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().strip().split()))
Q = int(input())
B = [0]*Q
C = [0]*Q

for i in range(Q):
    B[i],C[i] = map(int,input().split())

for i in range(Q):
    A = list(map(lambda x: C[i] if x == B[i] else x, A))
    print(sum(A))

Fixed submission:
N = int(input())
A = list(map(int, input().strip().split()))
Q = int(input())
B = [0]*Q
C = [0]*Q
from collections import Counter
K=Counter(A)
ans = 0

for i in range(Q):
    B[i],C[i] = map(int,input().split())


for i in K:
    ans += i * K[i]

for i in range(Q):
    ans -= B[i] * K[B[i]]
    ans += C[i] * K[B[i]]
    K[C[i]] += K[B[i]]
    K[B[i]] = 0
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().strip().split()))
Q = int(input())
B = [0]*Q
C = [0]*Q

for i in range(Q):
    B[i],C[i] = map(int,input().split())

def func(A,b,c):
    for i in range(len(A)):
        if A[i]==b:
            A[i]=c

for i in range(Q):
    func(A,B[i],C[i])
    print(sum(A))

Fixed submission:
N = int(input())
A = list(map(int, input().strip().split()))
Q = int(input())
B = [0]*Q
C = [0]*Q
from collections import Counter
K=Counter(A)
ans = 0

for i in range(Q):
    B[i],C[i] = map(int,input().split())


for i in K:
    ans += i * K[i]

for i in range(Q):
    ans -= B[i] * K[B[i]]
    ans += C[i] * K[B[i]]
    K[C[i]] += K[B[i]]
    K[B[i]] = 0
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().strip().split()))
from collections import Counter
C=Counter(A)
K=set(A)

culc = {}
# print(K)
# print(C)

for n in K:
    tmp = 0
    # print("n=",n)
    for i in C:
        if C[i] != 1:
            if i == n and C[i]-1 == 1:
                continue
            elif i == n :
                tmp += (C[i]-1)*(C[i]-2)//2
            else:
                tmp += C[i]*(C[i]-1)//2
    #     print("C=",i,"count",C[i],tmp)
    # print("K=",n,"の時、",tmp)
    culc[n]=tmp

# print(culc)

for i in range(N):
    print(culc[A[i]])
    

Fixed submission:
N = int(input())
A = list(map(int, input().strip().split()))
from collections import Counter
C=Counter(A)
K=set(A)
ans = 0
for i in K:
    ans += C[i]*(C[i]-1)//2

for i in A:
    print(ans-(C[i]-1)) # nシグマk = n(n-1)/2 ......

Buggy python submission (verdict: Time Limit Exceeded):
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result
    
    
N = int(input())
A = list(map(int, input().strip().split()))
from collections import Counter
C=Counter(A)
K=set(A)

culc = {}
# print(K)
# print(C)

for n in K:
    tmp = 0
    # print("n=",n)
    for i in C:
        if C[i] != 1:
            if i == n and C[i]-1 == 1:
                continue
            elif i == n :
                tmp += cmb(C[i]-1,2)
            else:
                tmp += cmb(C[i],2)
        # print("C=",i,"count",C[i],tmp)
    # print("K=",n,"の時、",tmp)
    culc[n]=tmp

# print(culc)

for i in range(N):
    print(culc[A[i]])
    

Fixed submission:
N = int(input())
A = list(map(int, input().strip().split()))
from collections import Counter
C=Counter(A)
K=set(A)
ans = 0
for i in K:
    ans += C[i]*(C[i]-1)//2

for i in A:
    print(ans-(C[i]-1)) # nシグマk = n(n-1)/2 ......
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    
    n = int(input())
    a = list(map(int,input().split()))
    for i in range(n):
        for j in range(i+1,n):
            if a[i]==a[j]:
                print("NO")
                return
    print("YES")

main()

Fixed submission:
def main():
    
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    for i in range(n-1):
        for j in range(i,i+1):
            if a[i]==a[i+1]:
                print("NO")
                return
    print("YES")

main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N,K = map(int, input().split())
    A = list(map(int,input().split()))
    P=[0]*N
    for i in range(N):
        P[i]=(A[i]+1)/2
    max=0
    check=0
    for i in range(N-K+1):
        for j in range(i,i+K):
            check +=P[j]
        if check > max:
            max=check
        check=0
    print(max)
main()    

Fixed submission:
def main():
    N,K = map(int, input().split())
    A = list(map(int,input().split()))
    P=[0]*N
    for i in range(N):
        P[i]=(A[i]+1)/2
    max=0
    check=0
            
    #for j in range(K):
    #    check +=P[j]
    check = sum(P[0:K])
    max=check
    #print(check)
    for i in range(K,N):
        check = check+P[i]-P[i-K]
        #print(i)
        #print(check)
        if check > max:
            max=check
    print(max)
main()
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c, d = map(int, input().split())
ma = a*c
for i in range(a, b+1):
    for j in range(c, d+1):
        if ma < i*j:
            ma = i*j
print(ma)

Fixed submission:
a, b, c, d = map(int, input().split())

ma = a*c
if  ma < a*c:
    ma = a*c
if ma < a*d:
    ma = a*d
if ma < b*c:
    ma = b*c
if ma < b*d:
    ma = b*d
print(ma)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 0

for i in range(N-1):
    for j in range(i+1, N):
        ans += A[i]*A[j]

print(ans % (10**9+7))

Fixed submission:
import itertools
N = int(input())
A = list(map(int, input().split()))
ans = 0
sumall = 0
for j in range(N):
    sumall += A[j]
for i in range(N):
    ans += A[i]*(sumall-A[i])
    sumall = sumall - A[i]

print(ans % (10**9+7))
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
tmp = 0
preR = 0
if S == "SSS":
    print(0)
elif S == 'RSS' or S == 'SRS' or S == 'SSR' or S ==  'RSR'):
    print(1)
elif S == 'RRS' or S == 'SRR':
    print(2)
elif S == 'RRR':
    print(3)

Fixed submission:
S = input()
ans = 0
tmp = 0
preR = 0
if S == "SSS":
    print(0)
elif S == 'RSS' or S == 'SRS' or S == 'SSR' or S ==  'RSR':
    print(1)
elif S == 'RRS' or S == 'SRR':
    print(2)
elif S == 'RRR':
    print(3)
Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(N):
    for j in range(i+1, N):
        count = 0
        for k in range(j + 1, N):
            if L[i] + L[j]  > L[k]  and L[i] < L[j]:
                count += 1
                #print(L[i], L[j], L[k], count)
            else:
                #print(L[i], L[j], L[k])
                break
            ans = ans + count
            #print(ans)
print(ans)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = 0
for i in range(N):
    for j in range(i+1, N):
        count = 0
        for k in range(j + 1, N):
            
            if L[i] + L[j]  > L[k]  and L[i] < L[j] and L[j] < L[k]:
                count += 1
                #print(i, j, k, count, ans)
            elif L[i] + L[j]  < L[k] :
                #print(L[i], L[j], L[k])
                break
        ans = ans + count
            #print(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
ans = 0

if X > 0:
    tmp = abs(X) % D
    if tmp  >= K:
        ans = X - D*K
    elif tmp < K:
        nK = K - tmp
        X1 = X- D*tmp
        X2 = X1 - D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
elif X < 0:
    tmp = abs(X) % D
    if tmp  >= K:
        ans = X + D*K
    elif tmp < K:
        nK = K - tmp
        X1 = X + D*tmp
        X2 = X1 + D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
else:
    if K %2 == 0:
        ans = 0
    else :
        ans = D
print(ans)

Fixed submission:
X, K, D = map(int, input().split())
ans = 0

if X > 0:
    tmp = abs(X) // D
    if tmp  >= K:
        ans = X-D*K
        
    elif tmp < K:
        nK = K - tmp
        X1 = X- D*tmp
        X2 = X1 - D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
        
elif X < 0:
    tmp = abs(X) // D
    if tmp  >= K:
        ans = X + D*K
    elif tmp < K:
        nK = K - tmp
        X1 = X + D*tmp
        X2 = X1 + D
        if nK %2 == 0:
            ans = X1
        else :
            ans = X2
else:
    if K %2 == 0:
        ans = 0
    else :
        ans = D
print(abs(ans))
Buggy python submission (verdict: Runtime Error):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    S = input()
    if S == AC:
        ac+=1
    elif S == "WA":
        wa += 1
    elif S== "TLE":
        tle += 1
    elif S == "RE":
        re += 1
print(f'AC x {ac}')
print(f'WA x {wa}')
print(f'TLE x {tle}' )
print(f'RE x {re}')

Fixed submission:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    S = input()
    if S == "AC":
        ac+=1
    elif S == "WA":
        wa += 1
    elif S== "TLE":
        tle += 1
    elif S == "RE":
        re += 1
print(f'AC x {ac}')
print(f'WA x {wa}')
print(f'TLE x {tle}' )
print(f'RE x {re}')

Buggy python submission (verdict: Runtime Error):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    S = input()
    if S == AC:
        ac+=1
    elif S == "WA":
        wa += 1
    elif S== "TLE":
        tle += 1
    elif S == "RE":
        re += 1
print(f'AC x {ac}'' )
print(f'WA x {wa}'' )
print(f'TLE x {tle}'' )
print(f'RE x {re}'' )

Fixed submission:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    S = input()
    if S == "AC":
        ac+=1
    elif S == "WA":
        wa += 1
    elif S== "TLE":
        tle += 1
    elif S == "RE":
        re += 1
print(f'AC x {ac}')
print(f'WA x {wa}')
print(f'TLE x {tle}' )
print(f'RE x {re}')

Buggy python submission (verdict: Runtime Error):
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    S = input()
    if S == AC:
        ac+=1
    elif S == "WA":
        wa += 1
    elif S== "TLE"
        tle += 1
    elif S == "RE"
        re += 1
print(f'AC x {ac}'' )
print(f'WA x {wa}'' )
print(f'TLE x {tle}'' )
print(f'RE x {re}'' )

Fixed submission:
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(N):
    S = input()
    if S == "AC":
        ac+=1
    elif S == "WA":
        wa += 1
    elif S== "TLE":
        tle += 1
    elif S == "RE":
        re += 1
print(f'AC x {ac}')
print(f'WA x {wa}')
print(f'TLE x {tle}' )
print(f'RE x {re}')
Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input())
ans = 0
for k in range(1, N+1):
    ans += k*len(sympy.divisors(k))
print(ans)

Fixed submission:
a = int(input())
print(int(a+a**2+a**3))
Buggy python submission (verdict: Runtime Error):
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[26] + name
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)

Fixed submission:
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[25] + name
                N = N//26
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)

Buggy python submission (verdict: Runtime Error):
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name = name + 'a'
    else:
            if N%26 == 0:
                name = name + alphabet[26]
            else:
                name = name + alphabet[N%26-1]
                N = N//26 +1
print(name)


Fixed submission:
N = int(input())

alphabet = ['a', 'b', 'c','d','e','f','g', 'h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
mm = 1
name = ''
while True:
    if N > 26 ** mm:
        N = N - 26 ** mm
        mm += 1
    else:
        break
#mmけた

for i in range(mm):
    
    

    if N< 1:
        name =  'a' +name
    else:
            if N%26 == 0:
                name = alphabet[25] + name
                N = N//26
            else:
                name = alphabet[N%26-1] + name
                N = N//26 +1
print(name)
Buggy python submission (verdict: Runtime Error):
xs = list(map(int, input().split()))

for i in range(5):
    if xs(i) == 0:
        print(i+1)

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

for i in range(5):
    if xs[i] == 0:
        print(i+1)
Buggy python submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if A < B:
    if (A+V*T >= B+ W*T):
        print("YES")
    else:
        print("NO")
else:
     if (A+V*T <= B+ W*T):
        print("YES")
    else:
        print("NO")

Fixed submission:
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if A < B:
    if (A+V*T >= B+ W*T):
        print("YES")
    else:
        print("NO")
else:
    if (A-V*T <= B - W*T):
        print("YES")
    else:
        print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
flg = 0
for i in range(N):
    ans = ans * A[i]

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

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


    if flg == 1:
        print(-1)
    else:
        print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
ans = 0
flg = 0
for i in range(N):
    ans = ans * A[i]
    if ans > 10**18:
        flg = 1
        break
if flg == 0:
    print(ans)
else:
    print(-1)

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


    if flg == 1:
        print(-1)
    else:
        print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
flg = 0
for i in range(N):
    ans = ans * A[i]
    if ans > 10**18:
        flg = 1
        break
if flg == 0:
    print(ans)
else:
    print(-1)

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


    if flg == 1:
        print(-1)
    else:
        print(ans)

Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(N):
    ans = ans * A[i]
print(ans)

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


    if flg == 1:
        print(-1)
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
A, B, N = map(int, input().split())
ans = 0
ans_max = 0
for x in range(1,N+1):
    ans = int(float(A*x)/float(B))-A*int(float(x)/float(B))
    if ans_max < ans:
        ans_max = ans
    if x > A and x > B:
        break
print(ans_max)

Fixed submission:
K = int(input())
A,B = map(int, input().split())
flg = 0
for i in range(A, B+1):
    if i%K == 0:
        flg = 1
if flg == 1:
    print('OK')
else:
    print('NG')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
ans = N


for i in range(N):
    s = input()
    if i == 0:
        S.append(s)
    else:
        flg = 0
        j  = 0
        while(flg == 0 and j < len(S)):
            if S[j] == s:
                ans = ans - 1
                flg = 1
            j = j+1
        if flg == 0:
            S.append(s)
        
print(ans)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')

Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
for j in range(len(S)):
    for i in range(j-2):
        if i < j:
            if int(S[i:j+1])%2019 == 0:
                ans = ans + 1
print(ans)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
ans = N
for i in range(N):
    S.append(input())
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
            if len(S[j]) == len(S[i]):
                if S[j][0] == S[i][0]:
                    if S[j] == S[i]:
                        S[j] = ''
                        ans = ans - 1
                        flg = 1
        j = j+1
print(ans)

Fixed submission:
S, W = map(int, input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0]*(N+1)
last_step= 0
for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if 1 == a[last_step]:
            dp[1] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[1] = 1
    else:
        if i  == a[last_step]:
            dp[i] = 0
            if last_step +1 < M:
                last_step += 1
        else:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)

Fixed submission:
N, M = map(int, input().split())
breakstep = [True]*(N+1)
for _ in range(M):
    breakstep[int(input())] = False
#a = [breakstep[int(input())] for _ in range(M)]
dp = [0]*(N+1)

for i in range(N+1):
    if i == 0:
        dp[0] = 1
    elif i == 1:
        if breakstep[i]:
            dp[1] = 1
    else:
        if breakstep[i]:
            dp[i] = dp[i-1] + dp[i-2]
print(dp[-1]%1000000007)
Buggy python submission (verdict: Runtime Error):
a, b = map(int(), raw_input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
elif:
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
if ((a*b)%2) == 0:
  print('Even')
elif:
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int(), input().split())
if ((a*b)%2) == 0:
  print('Even')
elif:
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int(), raw_input().split())
if ((a*b)%2) == 0:
  print('Even')
elif:
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
if a*b % 2 == 0 :
  print('Even')
elif :
  print('Odd')

Fixed submission:
a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
#C - Otoshidama
N, Y = map(int, input().split())

x_ans = -1
y_ans = -1
z_ans = -1
flg = 0

for x in range(N+1):
    for y in range(N+1-x):
        otoshidama = 10000*x + 5000*y + 1000*(N-x-z)
        if otoshidama == Y :
            flg = 1
            x_ans = x
            y_ans = y
            z_ans = z
print(x_ans, y_ans, z_ans)
                
    

Fixed submission:
#C - Otoshidama
N, Y = map(int, input().split())

x_ans = -1
y_ans = -1
z_ans = -1
flg = 0

for x in range(N+1):
    for y in range(N+1-x):
        otoshidama = 10000*x + 5000*y + 1000*(N-x-y)
        if otoshidama == Y :
            flg = 1
            x_ans = x
            y_ans = y
            z_ans = N-x-y
print(x_ans, y_ans, z_ans)
Buggy python submission (verdict: Runtime Error):
sss = input()
s1 = int(sss[0])
s2 = int(sss[1])
s3 = int(sss[2])
print(%d, s1+s2+s3)

Fixed submission:
sss = input()
s1 = int(sss[0])
s2 = int(sss[1])
s3 = int(sss[2])
print(s1+s2+s3)
Buggy python submission (verdict: Runtime Error):
n = int(input())
an = map(int, input().split())

count = 0
flg = 0
while flg == 0:
  for i in n:
    if (int(an[i]))%2 == 1:
      flg = 1
    elif i == n-1 && flg == 0:
      count = count + 1


Fixed submission:
n = int(input())
an = map(int, input().split())
anlist = list(an)
count = 0
flg = 0
while flg == 0:
  for i in range(n):
    if (anlist[i])%2 == 1:
      flg = 1
    else:
      anlist[i] = anlist[i]/2
  if flg == 0:
    count = count + 1
print(count)
flg = 0
count = 0
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
ans = 0
for X in range(K+1):
    for Y in range(K+1):
        for Z in range(K+1):
            if (X + Y + Z == S):
                ans += 1
print(ans)

Fixed submission:
K, S = map(int, input().split())
ans = 0
for X in range(K+1):
    for Y in range(K+1):
        if (S- X - Y >=  0 and S - X - Y <= K):
            ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = list(map(int, input().split()))
sum = 1
flag = 1
upper = pow(10, 18)
for num in nums:
  sum = sum * num
  if flag != 0:
    if sum > upper:
      flag = 2
  if num == 0:
    flag = 0
if flag == 2:
  print(-1)
else:
  print(sum * flag)


Fixed submission:
n = int(input())
nums = list(map(int, input().split()))
sum = 1
flag = 1
upper = pow(10, 18)
for num in nums:
  if flag == 1:
    sum = sum * num
    if sum > upper:
      flag = 2
  if num == 0:
    flag = 0
    break
if flag == 2:
  print(-1)
else:
  print(sum * flag)

Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int, input().split()))
sum = 1
flag = 1
upper = pow(10, 18)
for num in nums:
  sum = sum * num
  if sum > upper && flag != 0:
    flag = 2
  if num == 0:
    flag = 0
if flag == 2:
  print(-1)
else:
  print(sum * flag)

Fixed submission:
n = int(input())
nums = list(map(int, input().split()))
sum = 1
flag = 1
upper = pow(10, 18)
for num in nums:
  if flag == 1:
    sum = sum * num
    if sum > upper:
      flag = 2
  if num == 0:
    flag = 0
    break
if flag == 2:
  print(-1)
else:
  print(sum * flag)
Buggy python submission (verdict: Runtime Error):
N = raw_input()

L = [2, 1]
for i in range(2, N + 1):
    L.append(L[i - 2] + L[i - 1])

print L[N]

Fixed submission:
# -*- coding: utf-8 -*-
N = int(raw_input())

if N == 1:
    print(1)
else:
    L = [2, 1]
    for i in range(2, N + 1):
        L.append(L[i - 2] + L[i - 1])
    print L[N]