Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import bisect
N = int(input())
A = deque()
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    j = bisect.bisect_right(A,x)
    if len(A) == 0:
        A.append(x)
    elif i > 0:
        if x <= A[i-1]:
            A.insert(i-1, x)
        else:
            A[i-1] = x
    elif x <= A[i]:
        A.insert(i, x)
    elif x > A[i]:
        A[i] = x

print(len(A))

Fixed submission:
from collections import deque
import bisect
N = int(input())
A = deque()
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    if i == 0:
        A.appendleft(x)
    else:
        A[i-1] = x

print(len(A))

Buggy python submission (verdict: Runtime Error):
from collections import deque
import bisect
N = int(input())
A = deque()
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    j = bisect.bisect_right(A,x)
    if len(A) == 0:
        A.append(x)
    elif i > 0:
        if x <= A[i-1]:
            A.insert(i-1, x)
        else:
            A[i-1] = x
    elif x <= A[i]:
        A.insert(i, x)
    elif x > A[i]:
        A[i] = x

print(len(A))

Fixed submission:
from collections import deque
import bisect
N = int(input())
A = deque()
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    if i == 0:
        A.appendleft(x)
    else:
        A[i-1] = x

print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N = int(input())
A = []
B = []
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    j = bisect.bisect_right(A,x)
    if len(A) == 0:
        A.append(x)
    elif i > 0:
        if x <= A[i-1]:
            A.insert(i-1, x)
        else:
            A[i-1] = x
    elif x <= A[i]:
        A.insert(i, x)
    elif x > A[i]:
        A[i] = x

print(len(A))

Fixed submission:
from collections import deque
import bisect
N = int(input())
A = deque()
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    if i == 0:
        A.appendleft(x)
    else:
        A[i-1] = x

print(len(A))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = []

def search(n):
    len_a = len(A)
    if len_a == 0:
        A.append(n)
        return 1
    left = 0
    right = len_a-1
    while left < right:
        mid = (left+right) // 2
        if A[mid] == n:
            break
        elif n < A[mid]:
            right = mid-1
        else:
            left = mid+1

    mid = (left + right) // 2
    if A[mid] >= n:
        while mid >= 0:
            if A[mid] < n:
                A[mid] = n
                return 0
            mid -= 1
        if mid == -1:
            A.insert(0, n)
            return 1
    elif A[mid] < n:
        A[mid] = n
        return 0

ans = 0
for _ in range(N):
    a = int(input())
    ans += search(a)

print(ans)

Fixed submission:
from collections import deque
import bisect
N = int(input())
A = deque()
for _ in range(N):
    x = int(input())
    i = bisect.bisect_left(A,x)
    if i == 0:
        A.appendleft(x)
    else:
        A[i-1] = x

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

S = sum(A)
ans = []
for i in range(N):
    v = S
    for j in range((N-1)//2):
        v -= 2 * A[(2*j+1+i) % N]
    ans.append(v)

print(" ".join(map(str, ans)))

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

S = sum(A)
ans = []

# 山1
v = S
for i in range((N-1)//2):
    v -= 2 * A[(2*i+1) % N]
ans.append(v)

for i in range(1, N):
    ans.append(2*A[i-1] - ans[i-1])

print(" ".join(map(str, ans)))
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
N, K = map(int,input().split())

for i in range(1, K+1):
    ans = comb(N - K + 1, i, exact=True) * comb(K-1, i-1, exact=True)
    ans %= 10 ** 9 + 7
    print(ans)

Fixed submission:
N, K = map(int,input().split())
ans = N-K+1
print(ans)
for i in range(2, K+1):
    ans = ans * (N-K+2-i) * (K+1-i) // (i - 1) // i
    print(ans % (10 ** 9 + 7))

Buggy python submission (verdict: Runtime Error):
import math
N, K = map(int,input().split())

for i in range(1, K+1):
    ans = math.factorial(N - K + 1) // math.factorial(N - K + 1 - i) // math.factorial(i)
    ans *= math.factorial(K - 1) // math.factorial(K - i) // math.factorial(i - 1)
    ans %= 10 ** 9 + 7
    print(ans)


Fixed submission:
N, K = map(int,input().split())
ans = N-K+1
print(ans)
for i in range(2, K+1):
    ans = ans * (N-K+2-i) * (K+1-i) // (i - 1) // i
    print(ans % (10 ** 9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
A = []
for _ in range(M):
    A.append(int(input()))

dp = [ 0 for _ in range(N+5)]


dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
        dp[i] %= 1000000007
    if i+2 not in A:
        dp[i+2] += dp[i]
        dp[i] %= 1000000007

print(dp[N] % 1000000007)

Fixed submission:
import bisect
N, M = map(int,input().split())
A = []
for _ in range(M):
    A.append(int(input()))

dp = [ 0 for _ in range(N+5)]

def check(n):
    i = bisect.bisect_left(A, n)
    if i != M and A[i] == n:
        return False
    else:
        return True

dp[0] = 1
for i in range(N):
    if check(i+1):
        dp[i+1] += dp[i]
        dp[i] %= 1000000007
    if check(i+2):
        dp[i+2] += dp[i]
        dp[i] %= 1000000007

print(dp[N] % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
A = []
for _ in range(M):
    A.append(int(input()))

dp = [ 0 for _ in range(N+5)]


dp[0] = 1
for i in range(N):
    if i+1 not in A:
        dp[i+1] += dp[i]
    if i+2 not in A:
        dp[i+2] += dp[i]
    dp[i] %= 1000000007

print(dp[N] % 1000000007)


Fixed submission:
import bisect
N, M = map(int,input().split())
A = []
for _ in range(M):
    A.append(int(input()))

dp = [ 0 for _ in range(N+5)]

def check(n):
    i = bisect.bisect_left(A, n)
    if i != M and A[i] == n:
        return False
    else:
        return True

dp[0] = 1
for i in range(N):
    if check(i+1):
        dp[i+1] += dp[i]
        dp[i] %= 1000000007
    if check(i+2):
        dp[i+2] += dp[i]
        dp[i] %= 1000000007

print(dp[N] % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
A = []
for _ in range(M):
    A.append(int(input()))

dp = [ 0 for _ in range(N+5)]

dp[0] = 1
for i in range(N):
    if i in A:
        dp[i] = 0
        continue

    dp[i+1] += dp[i]
    dp[i+2] += dp[i]
    dp[i] %= 1000000007

print(dp[N] % 1000000007)


Fixed submission:
import bisect
N, M = map(int,input().split())
A = []
for _ in range(M):
    A.append(int(input()))

dp = [ 0 for _ in range(N+5)]

def check(n):
    i = bisect.bisect_left(A, n)
    if i != M and A[i] == n:
        return False
    else:
        return True

dp[0] = 1
for i in range(N):
    if check(i+1):
        dp[i+1] += dp[i]
        dp[i] %= 1000000007
    if check(i+2):
        dp[i+2] += dp[i]
        dp[i] %= 1000000007

print(dp[N] % 1000000007)
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())

dic = {}
i = 0
while (2 ** i) <= (10 ** 5):
    dic[i] = 0
    i += 1

for i in range(1, N+1):
    cnt = 0
    while i * (2 ** cnt) < K:
        cnt += 1
    dic[cnt] += 1

ans = 0
for k, v in dic.items():
    if v > 0:
        ans += v * (0.5 ** k) / N

print(ans)

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

ans = 0
for i in range(1, N+1):
    cnt = 0
    while i * (2 ** cnt) < K:
        cnt += 1
    ans += (0.5 ** cnt) / N

print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())

dic = {}
i = 0
while (2 ** i) <= (10 ** 5):
    dic[i] = 0
    i += 1

for i in range(1, N+1):
    cnt = 0
    while i * (2 ** cnt) < K:
        cnt += 1
    dic[cnt] += 1

ans = 0
for k, v in dic.items():
    if v > 0:
        ans += v * (0.5 ** k)

ans /= N
print(ans)

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

ans = 0
for i in range(1, N+1):
    cnt = 0
    while i * (2 ** cnt) < K:
        cnt += 1
    ans += (0.5 ** cnt) / N

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int,input().split())

ans = 0
for i in range(N//R+1):
    if N - R*i < 0:
        break
    for j in range(N//G+1):
        if N - R * i - G * j < 0:
            break
        if  N -R*i -G*j == 0:
            ans += 1
        elif N -R*i -G*j > 0 and (N -R*i -G*j) % B == 0:
            ans += 1

print(ans)

Fixed submission:
R, G, B, N = map(int,input().split())

ans = 0
for i in range(N//R+1):
    for j in range((N- R*i)//G+1):
        if (N -R*i -G*j) % B == 0:
            ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int,input().split())

ans = 0
for i in range(N//R+1):
    for j in range(N//G+1):
        if N - R * i - G * j < 0:
            break
        if  N -R*i -G*j == 0:
            ans += 1
        elif N -R*i -G*j > 0 and (N -R*i -G*j) % B == 0:
            ans += 1

print(ans)

Fixed submission:
R, G, B, N = map(int,input().split())

ans = 0
for i in range(N//R+1):
    for j in range((N- R*i)//G+1):
        if (N -R*i -G*j) % B == 0:
            ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
R, G, B, N = map(int,input().split())

ans = 0
for i in range(N//R+1):
    for j in range(N//G+1):
        if  N -R*i -G*j == 0:
            ans += 1
        elif N -R*i -G*j > 0 and (N -R*i -G*j) % B == 0:
            ans += 1

print(ans)

Fixed submission:
R, G, B, N = map(int,input().split())

ans = 0
for i in range(N//R+1):
    for j in range((N- R*i)//G+1):
        if (N -R*i -G*j) % B == 0:
            ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = list(map(int,input().split()))

L = [0]
g = 0
for i in range(N-1):
    g = math.gcd(g, A[i])
    L.append(g)

R = []
g = 0
for i in range(N-1):
    g = math.gcd(g, A[N-1-i])
    R.append(g)
R.reverse()
R.append(0)

ans = 0
for i in range(N):
    ans = max(ans, math.gcd(L[i],R[i]))

print(ans)





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

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a % b
    return a

L = [0]
g = 0
for i in range(N-1):
    g = gcd(g, A[i])
    L.append(g)

R = []
g = 0
for i in range(N-1):
    g = gcd(g, A[N-1-i])
    R.append(g)
R.reverse()
R.append(0)

ans = 0
for i in range(N):
    ans = max(ans, gcd(L[i],R[i]))

print(ans)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

L = [A, B, C, D, E]
S = []
for l in L:
    if l % 10 != 0:
        S.append(l % 10)
min_s = min(S)

s = 0
flag = True
for l in L:
    if flag and min_s == l % 10:
        s += l
        flag = False
    elif 0 == l % 10:
        s += l
    else:
        s += 10 * (l // 10) + 10
print(s)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

L = [A, B, C, D, E]
S = [10]
for l in L:
    if l % 10 != 0:
        S.append(l % 10)
min_s = min(S)

s = 0
flag = True
for l in L:
    if flag and min_s == l % 10:
        s += l
        flag = False
    elif 0 == l % 10:
        s += l
    else:
        s += 10 * (l // 10) + 10
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, P = map(int,input().split())

    if N == 1:
        print(P)
        exit()

    C = 1
    while pow(C, N) <= P:
        C += 1

    for i in range(C, 0, -1):
        if P % pow(i, N) == 0:
            print(i)
            exit()

    print(1)
if __name__ == '__main__':
    main()

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

    if N == 1:
        print(P)
        exit()

    ans = 1
    d = 2
    while d * d <= P:
        cnt = 0
        while P % d == 0:
            P //= d
            cnt += 1
        ans *= pow(d, cnt//N)
        d += 1

    print(ans)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, P = map(int,input().split())

    C = 1
    while pow(C, N) <= P:
        C += 1

    for i in range(C, 0, -1):
        if P % pow(i, N) == 0:
            print(i)
            exit()

    print(1)
if __name__ == '__main__':
    main()

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

    if N == 1:
        print(P)
        exit()

    ans = 1
    d = 2
    while d * d <= P:
        cnt = 0
        while P % d == 0:
            P //= d
            cnt += 1
        ans *= pow(d, cnt//N)
        d += 1

    print(ans)
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())

ans = 0
flag = True
while flag:
    flag = False
    for i in range(0, len(S)-1):
        if S[i] == "B" and S[i+1] == "W":
            S[i], S[i+1] = S[i+1], S[i]
            ans += 1
            flag = True

print(ans)

Fixed submission:
S = list(input())

ans = 0
B = 0
for s in S:
    if s == "B":
        B += 1
    else:
        ans += B

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
P = []
Y = []
B = [[] for _ in range(N)]
for _ in range(M):
    p, y = map(int,input().split())
    P.append(p)
    Y.append(y)
    B[p-1].append(y)

for i in range(N):
    B[i].sort()

for p, y in zip(P, Y):
    print("{:06}{:06}".format(p, B[p-1].index(y) + 1))






Fixed submission:
import bisect
N, M = map(int,input().split())
P = []
Y = []
B = [[] for _ in range(N)]
for _ in range(M):
    p, y = map(int,input().split())
    P.append(p)
    Y.append(y)
    B[p-1].append(y)

for i in range(N):
    B[i].sort()

for p, y in zip(P, Y):
    print("{:06}{:06}".format(p, bisect.bisect_left(B[p-1], y) + 1))
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = []
Y = []
H = []
for _ in range(N):
    x, y, h = map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)

for pos_x in range(101):
    for pos_y in range(101):
        need_h = -1
        for n in range(N):
            if H[n] > 0:
                tmp = H[n] + abs(X[n]-pos_x) + abs(Y[n]-pos_y)
            if need_h == -1:
                need_h = tmp
            else:
                if need_h != tmp:
                    need_h = -2
                    break
        if need_h == -2:
            continue

        for n in range(N):
            if H[n] == 0:
                tmp = H[n] + abs(X[n]-pos_x) + abs(Y[n]-pos_y)
                if need_h > tmp:
                    need_h = -2
                    break
        if need_h == -2:
            continue

        print(pos_x, pos_y, need_h)
        exit()


Fixed submission:
N = int(input())
X = []
Y = []
H = []
xc = None
yc = None
hc = None
for _ in range(N):
    x, y, h = map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)
    if h > 0:
        xc = x
        yc = y
        hc = h

for pos_x in range(101):
    for pos_y in range(101):
        center_h = hc + abs(xc - pos_x) + abs(yc - pos_y)

        flag = True
        for n in range(N):
            if H[n] != max(center_h - abs(X[n] - pos_x) - abs(Y[n] - pos_y), 0):
                flag = False
                break
        if flag:
            print(pos_x, pos_y, center_h)
            exit()

Buggy python submission (verdict: Runtime Error):
N = int(input())
X = []
Y = []
H = []
for _ in range(N):
    x, y, h = map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)

C = [[-1 for _ in range(101)] for _ in range(101)]
for i in range(101):
    for j in range(101):

        need = -1
        for n in range(N):
            if H[n] > 0:
                tmp = H[n] + abs(X[n]-i) + abs(Y[n]-j)
            if need == -1:
                need = tmp
            else:
                if need != tmp:
                    need = -2
                    break
        if need == -2:
            continue

        for n in range(N):
            if H[n] == 0:
                tmp = H[n] + abs(X[n] - i) + abs(Y[n] - j)
                if need > tmp:
                    need = -2
                    break
        if need == -2:
            continue

        print(i, j, need)
        exit()


Fixed submission:
N = int(input())
X = []
Y = []
H = []
xc = None
yc = None
hc = None
for _ in range(N):
    x, y, h = map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)
    if h > 0:
        xc = x
        yc = y
        hc = h

for pos_x in range(101):
    for pos_y in range(101):
        center_h = hc + abs(xc - pos_x) + abs(yc - pos_y)

        flag = True
        for n in range(N):
            if H[n] != max(center_h - abs(X[n] - pos_x) - abs(Y[n] - pos_y), 0):
                flag = False
                break
        if flag:
            print(pos_x, pos_y, center_h)
            exit()
Buggy python submission (verdict: Runtime Error):
N, x = map(int,input().split())
X = list(map(int,input().split()))

X.append(x)
X.sort()

ans = X[1] - X[0]
for i in range(1, N+1):
    t = X[i+1] - X[i]
    if t < ans:
        ans = t
print(ans)

Fixed submission:
N, X = map(int,input().split())
A = list(map(int,input().split()))

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

ans = abs(A[0]-X)
for a in A:
    ans = gcd(ans, abs(a-X))


print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int,input().split())

ans = 0
for i in range(K, N+1, K):
    for j in range(K, N+1, K):
        for k in range(K, N+1, K):
            ans += 1
if K % 2 == 0:
    for i in range(K//2, N+1, K):
        for j in range(K//2, N+1, K):
            for k in range(K//2, N+1, K):
                ans += 1
print(ans)

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

ans = 0
cnt = 0
for i in range(K, N+1, K):
    cnt += 1
ans += pow(cnt, 3)

if K % 2 == 0:
    cnt = 0
    for i in range(K//2, N+1, K):
        cnt += 1
    ans += pow(cnt, 3)
print(ans)

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

ans = 0
for i in range(K, N+1, K):
    for j in range(K, N+1, K):
        for k in range(K, N+1, K):
            ans += 1
if K % 2 == 0:
    for i in range(1, N+1):
        if i % K != K // 2:
            continue
        for j in range(1, N+1):
            if j % K != K // 2:
                continue
            for k in range(1, N+1):
                if k % K != K // 2:
                    continue
                ans += 1
print(ans)

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

ans = 0
cnt = 0
for i in range(K, N+1, K):
    cnt += 1
ans += pow(cnt, 3)

if K % 2 == 0:
    cnt = 0
    for i in range(K//2, N+1, K):
        cnt += 1
    ans += pow(cnt, 3)
print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    S = input()
    len_s = len(S)
    check = "AKIHABARA"
    idx = 0
    len_check = len(check)

    i = 0
    while i < len_s:
        s = S[i]
        if check[idx] == s:
            idx += 1
        elif idx+1 < len_check and s == check[idx+1] and "A" == check[idx]:
            idx += 2
        else:
            print("NO")
            exit()
        i += 1
    if idx >= 7:
        print("YES")
    else:
        print("NO")
if __name__ == '__main__':
    main()

Fixed submission:
def main():
    S = input()

    check = []
    for i in ["A", ""]:
        for j in ["A", ""]:
            for k in ["A", ""]:
                for l in ["A", ""]:
                    check.append(i + "KIH" + j + "B" + k + "R" + l)

    for C in check:
        if C == S:
            print("YES")
            exit()

    print("NO")
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
D = list(map(int,input().split()))
M = int(input())
T = list(map(int,input().split()))

for t in T:
    if t in D:
        D.remove(t)
    else:
        print("NO")
        exit()

print("YES")

Fixed submission:
N = int(input())
D = list(map(int,input().split()))
M = int(input())
T = list(map(int,input().split()))

dictD = {}
for d in D:
    if d in dictD:
        dictD[d] += 1
    else:
        dictD[d] = 1

dictT = {}
for t in T:
    if t in dictT:
        dictT[t] += 1
    else:
        dictT[t] = 1


for k, v in dictT.items():
    if k in dictD:
        if v > dictD[k]:
            print("NO")
            exit()
    else:
        print("NO")
        exit()

print("YES")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
D = list(map(int,input().split()))
M = int(input())
T = list(map(int,input().split()))

for d in D:
    if d in T:
        T.remove(d)

if T:
    print("NO")
else:
    print("YES")

Fixed submission:
N = int(input())
D = list(map(int,input().split()))
M = int(input())
T = list(map(int,input().split()))

dictD = {}
for d in D:
    if d in dictD:
        dictD[d] += 1
    else:
        dictD[d] = 1

dictT = {}
for t in T:
    if t in dictT:
        dictT[t] += 1
    else:
        dictT[t] = 1


for k, v in dictT.items():
    if k in dictD:
        if v > dictD[k]:
            print("NO")
            exit()
    else:
        print("NO")
        exit()

print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())

    for n in range(1, 3501):
        for h in range(1, 3501):
            if 4 * h * n - N * n - N * h != 0:
                w = N * h * n / (4*h*n - N * n - N * h)
                if w.is_integer() and w > 0:
                    print("{} {} {}".format(n, h, int(w)))
                    exit()

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())

    for n in range(1, 3501):
        for h in range(1, 3501):
            b = 4 * h * n - N * n - N * h
            if b > 0:
                w = N * h * n / b
                if w.is_integer():
                    print("{} {} {}".format(n, h, int(w)))
                    exit()

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for _ in range(N):
    a = int(input())
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

Fixed submission:
N = int(input())
dict = {}
for _ in range(N):
    a = int(input())
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

ans = 0
for v in dict.values():
    if v % 2 != 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
Q, H, S, D = map(int,input().split())
N = int(input())

if N % 2 == 1:
    ans = min(4*Q,2*H,S)
ans += (N//2) * min(8*Q, 4*H, 2*S, D)

print(ans)


Fixed submission:
Q, H, S, D = map(int,input().split())
N = int(input())

ans = 0
if N % 2 == 1:
    ans = min(4*Q,2*H,S)
ans += (N//2) * min(8*Q, 4*H, 2*S, D)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int,input().split())
G = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append(b)

E = []
for v in G[0]:
    if v in E:
        continue
    E.append(v)
    for v2 in G[v]:
        if v2 in E:
            continue
        E.append(v2)

if (N-1) in E:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
N, M = map(int,input().split())
S = [False for _ in range(N)]
G = [False for _ in range(N)]
for _ in range(M):
    a, b = map(int,input().split())
    a -= 1
    b -= 1
    if a == 0 and b == N - 1:
        print("POSSIBLE")
        exit()
    if a == 0:
        if G[b]:
            print("POSSIBLE")
            exit()
        S[b] = True
    if b == N - 1:
        if S[a]:
            print("POSSIBLE")
            exit()
        G[a] = True

print("IMPOSSIBLE")