Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
a, b, c = [0] * M, [0] * M, [0] * M
d = [-1e20] * N
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -= 1
    b[i] -= 1

d[0] = 0
for i in range(N-1):
    for j in range(M):
        d[b[j]] = max((d[b[j]], d[a[j]] + c[j]))

isCycle = False
for i in range(N-1):
    if isCycle:
        break
    for j in range(M):
        if b[j] == N-1 and d[b[j]] < d[a[j]] + c[j]:
            isCycle = True
            break
        d[b[j]] = max((d[b[j]], d[a[j]] + c[j]))
if isCycle:
    print('inf')
else:
    print(d[N-1])


Fixed submission:
N, M = map(int, input().split())
a, b, c = [0] * M, [0] * M, [0] * M
INF = int(1e13) + 1
for i in range(M):
    a[i], b[i], c[i] = map(int, input().split())
    a[i] -= 1
    b[i] -= 1

d = [-INF] * N
d[0] = 0
for __x in range(N-1):
    for i in range(M):
        if d[b[i]] < d[a[i]] + c[i]:
            d[b[i]] = d[a[i]] + c[i]

isCycle = False
for __x in range(N-1):
    if isCycle:
        break
    for i in range(M):
        if d[b[i]] < d[a[i]] + c[i]:
            d[b[i]] = d[a[i]] + c[i]
            if b[i] == N-1:
                isCycle = True
                break

if isCycle:
    print('inf')
else:
    print(d[N-1])
Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
minW = min(w)
for i in range(N):
    w[i] -= minW
MAX_W = 3 * 100
MAX_V = int(1e9)
INF = MAX_V + 2
dp = [[-INF] * (MAX_W + 10) for i in range(N+1)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_W, -1, -1):
        for k in range(N-1, -1, -1):
            dp[k+1][j+w[i]] = max((dp[k+1][j+w[i]], dp[k][j] + v[i]))

ans = 0
for i in range(N+1):
    for j in range(i * MAX_W + 1):
        if i * minW + j <= W:
            # print('i * minW: %d, j: %d, dp: %d' % (i*minW, j, dp[i][j]))
            ans = max((ans, dp[i][j]))

print(ans)

Fixed submission:
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
minW = min(w)
for i in range(N):
    w[i] -= minW
MAX_W = 3 * 100
MAX_V = int(1e9)
INF = MAX_V + 2
dp = [[-INF] * (MAX_W + 10) for i in range(N+1)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_W, -1, -1):
        for k in range(N-1, -1, -1):
            dp[k+1][j+w[i]] = max((dp[k+1][j+w[i]], dp[k][j] + v[i]))

ans = 0
for i in range(N+1):
    for j in range(MAX_W + 1):
        if i * minW + j <= W:
            # print('i * minW: %d, j: %d, dp: %d' % (i*minW, j, dp[i][j]))
            ans = max((ans, dp[i][j]))

print(ans)

Buggy python submission (verdict: Runtime Error):
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())

minW = min(w)
for i in range(N):
    w[i] -= minW

INF = int(1e9)
dp = [[-INF] * (3 * N + 1) for i in range(N+1)]

dp[0][0] = 0
ans = 0
for i in range(N):
    for j in range(N, 0, -1):
        for k in range(3 * N + 1):
            if k + w[i] + minW * j <= W:
                dp[j][k+w[i]] = max((dp[j][k+w[i]], dp[j-1][k] + v[i]))
                ans = max((ans, dp[j][k+w[i]]))
# print('\n'.join(map(str, dp)))
print(ans)


Fixed submission:
N, W = map(int, input().split())
w, v = [0] * N, [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
minW = min(w)
for i in range(N):
    w[i] -= minW
MAX_W = 3 * 100
MAX_V = int(1e9)
INF = MAX_V + 2
dp = [[-INF] * (MAX_W + 10) for i in range(N+1)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_W, -1, -1):
        for k in range(N-1, -1, -1):
            dp[k+1][j+w[i]] = max((dp[k+1][j+w[i]], dp[k][j] + v[i]))

ans = 0
for i in range(N+1):
    for j in range(MAX_W + 1):
        if i * minW + j <= W:
            # print('i * minW: %d, j: %d, dp: %d' % (i*minW, j, dp[i][j]))
            ans = max((ans, dp[i][j]))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, Ma, Mb = map(int, input().split())
a, b, c = [0] * N, [0] * N, [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())

S = 411
MAX_N = 10
MAX_SIZE = 400
INF = int(1e9)
dp = [[INF] * S for i in range(S)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_SIZE, -1, -1):
        for k in range(MAX_SIZE, -1, -1):
            dp[j+a[i]][k+b[i]] = min((dp[j+a[i]][k+b[i]], dp[j][k] + c[i]))

ans = INF
for i in range(1, MAX_N):
    ans = min((ans, dp[i*Ma][i*Mb]))
if ans == INF:
    print(-1)
else:
    print(ans)


Fixed submission:
N, Ma, Mb = map(int, input().split())
a, b, c = [0] * N, [0] * N, [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())

S = 411
MAX_N = 10
MAX_SIZE = 400
INF = int(1e9)
dp = [[INF] * S for i in range(S)]
dp[0][0] = 0
for i in range(N):
    for j in range(MAX_SIZE, -1, -1):
        for k in range(MAX_SIZE, -1, -1):
            dp[j+a[i]][k+b[i]] = min((dp[j+a[i]][k+b[i]], dp[j][k] + c[i]))

ans = INF
for i in range(1, MAX_N):
    ans = min((ans, dp[i*Ma][i*Mb]))
if ans == INF:
    print(-1)
else:
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K, L = map(int, input().split())
u1, u2 = list(range(N+1)), list(range(N+1))

def root(u, r):
    if u[r] == r:
        return r
    u[r] = root(u, u[r])
    return u[r]

def update(u, r, n):
    u[root(u, n)] = root(u, r)

for i in range(K):
    p, q = map(int, input().split())
    update(u1, p, q)

for i in range(L):
    r, s = map(int, input().split())
    update(u2, r, s)

c = {}
rs = [(root(u1, i), root(u2, i)) for i in range(1, N+1)]
for r in rs:
    if r in c:
        c[r] += 1
    else:
        c[r] = 1
 
print(' '.join(map(str, [c[r] for r in rs])))


Fixed submission:
N, K, L = map(int, input().split())
u1 = [i for i in range(N)]
u2 = [i for i in range(N)]

def root(u, n):
    if u[n] == n:
        return n
    else:
        t = root(u, u[n])
        u[n] = t
        return t

def update(u, r, n):
    u[root(u, n)] = root(u, r)

for i in range(K):
    p, q = map(int, input().split())
    p -= 1
    q -= 1
    update(u1, p, q)

for i in range(L):
    r, s = map(int, input().split())
    r -= 1
    s -= 1
    update(u2, r, s)

p = [(root(u1, i), root(u2, i)) for i in range(N)]
ans = {}
for x in p:
    if x not in ans:
        ans[x] = 1
    else:
        ans[x] += 1
print(' '.join(map(str, [ans[x] for x in p])))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
ans = 0
def neg(c):
    if c == 'W':
        return 'B'
    else:
        return 'W'

while 'W' in s and 'B' in s:
    ans += 1
    l = s[0]
    r = s[-1]
    cl = 0
    cr = len(s) - 1
    while l == s[cl]:
        cl += 1
    while r == s[cr]:
        cr += -1
    if cr > cl:
        s = s[:cr] + (len(s) - cr + 1) * neg(r)
    else:
        s = (cl+1) * neg(l) + s[cl:]
print(ans)


Fixed submission:
s = input()
n = len(s)

print(sum([ 1 for i in range(n-1) if s[i] != s[i+1]]))
Buggy python submission (verdict: Time Limit Exceeded):
N, T = map(int, input().split())
A = list(map(int, input().split()))

l = 0
r = max(A)
m = (r + l) // 2

def cal(N, T, A):
    return max([A[i] - min(A[:i]) for i in range(1,len(A))]) * T // 2

ans = 0
m = cal(N, T, A)
mini = A[0]
for i in range(1, N):
    mini = min((mini, A[i]))
    if m == (A[i] - mini) * T // 2:
        ans += 1
print(ans)



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


m = 0
_mini = A[0]
for i in range(1, N):
    _mini = min((_mini, A[i]))
    m = max((m, A[i] - _mini))

ans = 0
mini = A[0]
for i in range(1, N):
    mini = min((mini, A[i]))
    if m == (A[i] - mini):
        ans += 1
print(ans)

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

l = 0
r = max(A)
m = (r + l) // 2

def cal(N, T, A):
    return max([A[i] - min(A[:i]) for i in range(1,len(A))]) * T // 2

ans = 0
m = cal(N, T, A)
for i in range(1, N):
    if m == (A[i] - min(A[:i])) * T // 2:
        ans += 1
print(ans)



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


m = 0
_mini = A[0]
for i in range(1, N):
    _mini = min((_mini, A[i]))
    m = max((m, A[i] - _mini))

ans = 0
mini = A[0]
for i in range(1, N):
    mini = min((mini, A[i]))
    if m == (A[i] - mini):
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
T = [0]*N
A = [0]*N
for i in range(N):
    T[i],A[i] = map(int,input().split())

def aa(a,t,na,nt):
    c = 1
    while not(a<=na*c and t<=nt*c):
        c += 1
    return (na*c,nt*c)
t = T[0]
a = A[0]
for i in range(N):
    a,t = aa(a,t,A[i],T[i])
print(t+a)


Fixed submission:
N = int(input())
T = [0]*N
A = [0]*N
for i in range(N):
    T[i],A[i] = map(int,input().split())

def aa(a,t,na,nt):
    c = max( (1+(a-1)//na,1+(t-1)//nt) )
    return (na*c,nt*c)
t = T[0]
a = A[0]
for i in range(N):
    a,t = aa(a,t,A[i],T[i])
print(t+a)
Buggy python submission (verdict: Runtime Error):

N,H = map(int,input().split())

a = []
b = []
finish = 0

for i in range(1,N+1):
    elem1, elem2 = map(int,input().split())
    a.append(elem1)
    b.append(elem2)

maxB = max(b)
maxA = max(a)
sum = maxB
b.remove(maxB)
count = 1
for elem in b:
    if elem > maxA:
        sum = sum + elem
    #print(sum)
        count += 1
        if sum > H:
            finish = 1
            break


#print(sum)
if finish == 0:
    dev = int(((H - sum)/(maxA))
    count = count + dev
    sum = sum + dev * maxA
    if sum < H:
        count += 1

print(count)


Fixed submission:

N,H = map(int,input().split())

a = []
b = []
finish = 0

for i in range(1,N+1):
    elem1, elem2 = map(int,input().split())
    a.append(elem1)
    b.append(elem2)


b = sorted(b, key=int, reverse=True)

maxB = max(b)
maxA = max(a)
sum = maxB
b.remove(maxB)
count = 1
for elem in b:
    if elem > maxA and sum < H:
        sum = sum + elem
        count += 1
    if sum >= H:
        finish = 1
        break


#print(sum)
if finish == 0:
    dev = int((H - sum)/maxA)
    count = count + dev
    sum = sum + dev * maxA
    if sum < H:
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):

N,H = map(int,input().split())

a = []
b = []
finish = 0

for i in range(1,N+1):
    elem1, elem2 = map(int,input().split())
    a.append(elem1)
    b.append(elem2)

#print(max(b))
sum = max(b)
b.remove(max(b))
count = 1
for elem in b:
    if elem > max(a):
        sum = sum + elem
    #print(sum)
        count += 1
        if sum > H:
            finish = 1
            break


#print(sum)
if finish == 0:
    dev = int(((H - sum)/(max(a))))
    count = count + dev
    sum = sum + dev * max(a)
    if sum < H:
        count += 1

print(count)


Fixed submission:

N,H = map(int,input().split())

a = []
b = []
finish = 0

for i in range(1,N+1):
    elem1, elem2 = map(int,input().split())
    a.append(elem1)
    b.append(elem2)


b = sorted(b, key=int, reverse=True)

maxB = max(b)
maxA = max(a)
sum = maxB
b.remove(maxB)
count = 1
for elem in b:
    if elem > maxA and sum < H:
        sum = sum + elem
        count += 1
    if sum >= H:
        finish = 1
        break


#print(sum)
if finish == 0:
    dev = int((H - sum)/maxA)
    count = count + dev
    sum = sum + dev * maxA
    if sum < H:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a=input("");
flag=False;
for i in xrange(0,len(a)-2):
  if a[i]=='A' and a[i+1]=='C':
    flag=True;
if flag==True:
  print("Yes");
else:
  print("No");


Fixed submission:
a=input("");
flag=False;
for i in range(0,len(a)-1):
  if a[i]=='A' and a[i+1]=='C':
    flag=True;
if flag==True:
  print("Yes");
else:
  print("No");

Buggy python submission (verdict: Runtime Error):
a=input("")
flag=False
for i in xrange(0,len(a)-2):
  if a[i]=='A' and a[i+1]=='C':
    flag=True
if flag==True:
  print("Yes")
else:
  print("No")

Fixed submission:
a=input("");
flag=False;
for i in range(0,len(a)-1):
  if a[i]=='A' and a[i+1]=='C':
    flag=True;
if flag==True:
  print("Yes");
else:
  print("No");
Buggy python submission (verdict: Runtime Error):
moji = input()
N = moji[0]
A = moji[2]
B = moji[4]

res = ""

if ((int)(B) - (int)(A))%2 == 0:
    res = "Alice"
else:
    res = "Borys"

print(res)


Fixed submission:
moji = input()
moji = moji.split(" ")
N = moji[0]
A = moji[1]
B = moji[2]

res = ""

if ((int)(B) - (int)(A))%2 == 0:
    res = "Alice"
else:
    res = "Borys"

print(res)

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

res = ""

if ((int)(B) - (int)(A))%2 == 0:
    res = "Alice"
else:
    res = "Borys"

print(res)


Fixed submission:
moji = input()
moji = moji.split(" ")
N = moji[0]
A = moji[1]
B = moji[2]

res = ""

if ((int)(B) - (int)(A))%2 == 0:
    res = "Alice"
else:
    res = "Borys"

print(res)
Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
	t = b
	b = a % b
	
	if b == 0:
		return t
	else:
		return gcd(t,b)
        
def lcm(a, b):
    return a * b / gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(int(ans))

Fixed submission:
import fractions
        
def lcm(a, b):
    return a * b // fractions.gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)

Buggy python submission (verdict: Runtime Error):
def gcd(a,b):
	t = b
	b = a % b
	
	if b == 0:
		return t
	else:
		return gcd(t,b)
        
def lcm(a, b):
    return a * b / gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)

Fixed submission:
import fractions
        
def lcm(a, b):
    return a * b // fractions.gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)

Buggy python submission (verdict: Runtime Error):
import math 
def lcm(a, b):
    return a * b / math.gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)

Fixed submission:
import fractions
        
def lcm(a, b):
    return a * b // fractions.gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)

Buggy python submission (verdict: Runtime Error):
import math 
def lcm(a, b):
    return a * b // math.gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)

Fixed submission:
import fractions
        
def lcm(a, b):
    return a * b // fractions.gcd(a, b)

n = int(input())

ans = 1
for i in range(n):
    ans = lcm(ans, int(input()))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
cnt = 0
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

for i in range(n - 1, -1, -1):
    if a[i] % b[i] != 0:
        r = b[i] - a[i] % b[i]
        cnt += r
        for j in range(i + 1):
            a[j] += r

print(cnt)


Fixed submission:
n = int(input())
cnt = 0
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

for i in range(n - 1, -1, -1):
    r = b[i] - (a[i] + cnt) % b[i]
    if  r != b[i]:
        cnt += r
print(cnt)
Buggy python submission (verdict: Runtime Error):
pr = [True] * 1001
n = int(input())
ans = 1
MOD = 10 ** 9 + 7

for i in range(2, n + 1):
    if pr[i]:
        for j in range(i * 2, n + 1, i):
            pr[j] = False
        cnt = 0
        now = n
        while now:
            cnt += now // i
            now //= i
        ans = ans * (cnt + 1) % MOD

print(ans)


Fixed submission:
a, b, c, d = map(int, input().split())
print(max(a*b, c*d))
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())
cnt = 0

for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if x + y + z == s:
                cnt += 1
print(cnt)


Fixed submission:
k, s = map(int, input().split())
cnt = 0

for i in range(k + 1):
    t = s - i
    if t >= 0:
        cnt += max(0, (t + 1) - 2 * (max(0, t - k)))
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(i) for i in input().split()]
sa=set(a)
f=True
if n%2==0:
    if sa=={int(i) for i in range(1,n,2)}:
        for i in range(1,n,2):
            if a.count(i)!=2:
                f=False
                break
    else:
        f=False
else:
    if a.count(0)==1:
        for i in range(2,n,2):
            if a.count(i)!=2:
                f=False
                break
    else:
        f=False
print(2**(n//2) if f else 0)


Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
f=True
if n%2==0:
    for i in range(n):
        if a[i]!=i//2*2+1:
            f=False
            break
else:
    for i in range(n):
        if a[i]!=(i+1)//2*2:
            f=False
            break
print(2**(n//2)%(10**9+7) if f else 0)
Buggy python submission (verdict: Runtime Error):
a=["eraser","erase","dreamer","dream"]
s=input()
for i in range(4):
    s=s.replace(a[i],"")
if s="":
    print("YES")
else:
    print("NO")

Fixed submission:
print("vowel" if input() in "aiueo" else "consonant")
Buggy python submission (verdict: Runtime Error):
a=["eraser","erase","dreamer","dream"]
s=input()

for i in range(4):
    s=s.replace(a[i],"")
if s="":
    print("YES")
else:
    print("NO")

Fixed submission:
s=input()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.replace("dreamer","")
s=s.replace("dream","")
if len(s)==0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
if s==t:
    print(n)
else:
    ans=2*n
    f=False
    for i in range(n):
        for j range(i+1):
            if t[j]!=s[n-1-i+j]:
                f=True
        if not f:
            break
        ans-=1
    print(ans)

Fixed submission:
n=int(input())
s=input()
t=input()
i=0
while n>i:
    if i==0 and s==t:
        break
    if t[:-i]==s[i:]:
        break
    i+=1
print(n+i)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
if s==t:
    print(n)
else:
    ans=2*n
    f=True
    for i in range(n):
        for j in range(i+1):
            if t[j]==a[n-1-i+j]:
                f=False
        if not f:
            break
        ans-=1
    print(ans)

Fixed submission:
n=int(input())
s=input()
t=input()
i=0
while n>i:
    if i==0 and s==t:
        break
    if t[:-i]==s[i:]:
        break
    i+=1
print(n+i)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
if s==t:
    print(n)
else:
    ans=2*n
    f=True
    for i in range(n):
        for j range(i+1):
            if t[j]==a[n-1-i+j]:
                f=False
        if !f:
            break
        ans-=1
    print(ans)

Fixed submission:
n=int(input())
s=input()
t=input()
i=0
while n>i:
    if i==0 and s==t:
        break
    if t[:-i]==s[i:]:
        break
    i+=1
print(n+i)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
if s==t:
    print(n)
else:
    ans=2*n
    f=True
    for i in range(n):
        for j range(i+1):
            if t[j]==a[n-1-i+j]:
                f=False
        if not f:
            break
        ans-=1
    print(ans)

Fixed submission:
n=int(input())
s=input()
t=input()
i=0
while n>i:
    if i==0 and s==t:
        break
    if t[:-i]==s[i:]:
        break
    i+=1
print(n+i)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input()
t=input()
if s==t:
    print(n)
else:
    ans=2*n
    f=True
    for i in range(n):
        for j range(i+1):
            if t[j]==a[n-1-i+j]:
                f=False
        if not f:
            break
    print(ans)

Fixed submission:
n=int(input())
s=input()
t=input()
i=0
while n>i:
    if i==0 and s==t:
        break
    if t[:-i]==s[i:]:
        break
    i+=1
print(n+i)
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
        elif i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")


Fixed submission:
s=input()
v="CODEFESTIVAL2016"
cnt=0
for i in range(16):
    if s[i]==v[i]:
        cnt+=1
print(16-cnt)

Buggy python submission (verdict: Runtime Error):
        s=list(input())
        v=list("CODEFESTIVAL2016")
        cnt=0
        for i in range(16):
            if s[i]!=v[i]:
                cnt+=1
        print(cnt)

Fixed submission:
s=input()
v="CODEFESTIVAL2016"
cnt=0
for i in range(16):
    if s[i]==v[i]:
        cnt+=1
print(16-cnt)

Buggy python submission (verdict: Runtime Error):
    s=input()
    v="CODEFESTIVAL2016"
    cnt=0
    for i in range(16):
        if s[i]!=v[i]:
            cnt+=1
    print(cnt)

Fixed submission:
s=input()
v="CODEFESTIVAL2016"
cnt=0
for i in range(16):
    if s[i]==v[i]:
        cnt+=1
print(16-cnt)
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
       elif i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")


Fixed submission:
n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
        if i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n,a,b=map(int,input().split())
s=input()
Pass=[]
out=1
for i in range(n):
    if s[i]=="a" and len(Pass)+1<=a+b:
            Pass.append(i)
    if s[i]=="b" and len(Pass)+1<=a+b and out<=b:
            Pass.append(i)
            out+=1
for i in range(n):
    print("Yes" if i in Pass else "No")


Fixed submission:
n,a,b=map(int,input().split())
s=input()
for i in s:
    if a+b>0:
        if i=="a":
            a-=1
            print("Yes")
            continue
        if i=="b" and b>0:
            b-=1
            print("Yes")
            continue
    print("No")
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
d=[i for i in input().split()]
while True:
    f=False
    for i in d:
        if i not in str(n):
            f=True
            break
    if f:
        break
    n+=1
print(n)

Fixed submission:
a=sorted([int(i) for i in input().split()])
print("YES" if a==[5,5,7] else "NO")
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
print("".join(sorted[input() for i in range(n)]))

Fixed submission:
n,_=map(int,input().split())
print("".join(sorted([input() for i in range(n)])))
Buggy python submission (verdict: Time Limit Exceeded):
as_ = []
for _ in range(int(input())):
    a = int(input())
    if a in as_:
        as_.remove(a)
    else:
        as_.append(a)

print(len(as_))

Fixed submission:
as_ = set()
for _ in range(int(input())):
    a = int(input())
    if a in as_:
        as_.remove(a)
    else:
        as_.add(a)
 
print(len(as_))