Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
s = list(input())
q = int(input())
cnt = 0
s = deque(s)
for i in range(q):
    l = input().split()
    if l[0] == "1":
        s.reverse()
        continue
    if l[1] == "1":
        s.appendleft(l[2])
    else:
        s.append(l[2])
print(*s, sep="")

Fixed submission:
s = input()
q = int(input())
t = ""
for i in range(q):
    que = input().split()
    if que[0] == "1":
        s, t = t, s
    else:
        if que[1] == "1":
            t += que[2]
        else:
            s += que[2]
print(t[::-1] + s)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
q = int(input())
query = [list(input().split()) for i in range(q)]
for i in query:
    if i[0] == "1":
        s.reverse()
    else:
        if i[1] == "1":
            s.insert(0, i[2])
        else:
            s.append(i[2])
print(*s, sep="")

Fixed submission:
s = input()
q = int(input())
t = ""
for i in range(q):
    que = input().split()
    if que[0] == "1":
        s, t = t, s
    else:
        if que[1] == "1":
            t += que[2]
        else:
            s += que[2]
print(t[::-1] + s)

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
q = int(input())
query = [list(input().split()) for i in range(q)]
for i in query:
    if i[0] == "1":
        s.reverse()
    else:
        if i[1] == "1":
            s.insert(0, i[2])
        else:
            s.append(i[2])
print(*s, sep="")

Fixed submission:
s = input()
q = int(input())
t = ""
for i in range(q):
    que = input().split()
    if que[0] == "1":
        s, t = t, s
    else:
        if que[1] == "1":
            t += que[2]
        else:
            s += que[2]
print(t[::-1] + s)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(m)]
l = []
l2 = []
l3 = [0 for i in range(n)]
cnt = 0
if (m == 0 and n == 1) or (n == 1 and m == 1 and sc[0] == [1, 0]):
    print(0)
    exit()
for i in sc:
    if i[0] == 1 and i[1] == 0:
        print(-1)
        exit()
    elif i[0] in l and l2[l.index(i[0])] != i[1]:
        print(-1)
        exit()
    else:
        l.append(i[0])
        l2.append(i[1])
        l3[i[0] - 1] = i[1]
        cnt += 1
if l3[0] == 0:
    l3[0] = 1
print(*l3, sep="")

Fixed submission:
N = int(input())
if N % 2 == 0:
  print(int(N / 2))
else:
  print(int(N / 2 + 1))
Buggy python submission (verdict: Runtime Error):
def conv(x, n):
    nchar = '0123456789ABCDEF'
    digit = 0
 
    result = ''
 
    while x > 0:
        result = nchar[x % n] + result
        x = x / n
 
    return result
n, k = map(int, input().split())
print(conv(n, k))

Fixed submission:
from math import log
n, k = map(int, input().split())
print(int(log(n, k)) + 1)
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
n, a, b = map(int, input().split())
print(int(pow(2, n) - 1 - comb(n, a) - comb(n, b)) % (10 ** 9 + 7))

Fixed submission:
n, a, b = map(int, input().split())
mod = 10 ** 9 + 7
u, d, c = [1], [1], [1]
for i in range(1, b + 1):
    u.append(u[-1] * (n - i + 1) % mod)
    d.append(d[-1] * i % mod)
    c.append(u[i] * pow(d[i], mod - 2, mod) % mod)
print((pow(2, n, mod) - 1 - c[a] - c[b]) % mod)
Buggy python submission (verdict: Time Limit Exceeded):
k, q = map(int, input().split())
d = list(map(int, input().split()))
nxm = [list(map(int, input().split())) for i in range(q)]
for n, x, m in nxm:
    prev = x
    ans = 0
    cur = 0
    for i in range(k):
        prev += (d[i] % m) * ((n + k - i  - 2) // k)
        if d[i] % m == 0:
            cur += ((n + k - i  - 2) // k)
    print(n - prev // m + x // m - cur - 1)

Fixed submission:
k, q = map(int, input().split())
d = list(map(int, input().split()))
nxm = [list(map(int, input().split())) for i in range(q)]
for n, x, m in nxm:
    prev = x
    ans = 0
    cur = 0
    for i in range(k):
        prev += (d[i] % m) * ((n + k - i  - 2) // k)
        if d[i] % m == 0:
            cur += ((n + k - i  - 2) // k)
    print(n - prev // m + x // m - cur - 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
numbers = list(map(int, input().split()))
for number in nunbers:
  if number % 2 == 0:
    if number % 3 != 0 or number % 5 != 0:
      print("DENIED")
      break
print("APPROVED")
      

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
for i in A:
  if i % 2 == 0:
    if i % 3 == 0 or i % 5 == 0:
      continue
    else:
      print("DENIED")
      exit()
  else:
    continue
print("APPROVED")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = dict()
s = [input() for i in range(n)]
l = []
for i in set(s):
    d[i] = 0
for i in s:
    d[i] += 1
l = [k for k, v in d.items() if v == max(d.values())]
l.sort()
print(*l, sep="\n")

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
m = c.most_common()[0][1]
l = []
for i in c.keys():
    if c[i] == m:
        l.append(i)
l.sort()
print(*l, sep="\n")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
d = dict()
s = [input() for i in range(n)]
l = []
for i in set(s):
    d[i] = 0
for i in s:
    d[i] += 1
l = [k for k, v in d.items() if v == max(d.values())]
l.sort()
print(*l, sep="\n")

Fixed submission:
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
m = c.most_common()[0][1]
l = []
for i in c.keys():
    if c[i] == m:
        l.append(i)
l.sort()
print(*l, sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
posi = []
nega = []
zero = []
for i in range(n):
    if a[i] < 0:
        nega.append(a[i] * -1)
    elif a[i] > 0:
        posi.append(a[i])
    else:
        zero.append(a[i])
zero = len(zero)
posi.sort()
nega.sort()
lp, ln = len(posi), len(nega)
if k <= lp * ln:
    l, r = 0, 10 ** 18
    while r - l > 1:
        m = (l + r) // 2
        cnt = lp * ln
        cur = 0
        for i in range(ln)[::-1]:
            while cur < lp and posi[cur] < (m + nega[i] - 1) // nega[i]:
                cur += 1
            cnt -= cur
        if cnt >= k:
            l = m
        else:
            r = m
    print(-1 * l)
elif k <= n * (n - 1) // 2 - (lp * (lp - 1) // 2) - (ln * (ln - 1) // 2):
    print(0)
else:
    k -= n * (n - 1) // 2 - (lp * (lp - 1) // 2) - (ln * (ln - 1) // 2)
    l, r = 0, 10 ** 18
    while r - l > 1:
        m = (l + r) // 2
        cnt = 0
        cur = ln - 1
        for i in range(ln):
            while cur and nega[cur] > m // nega[i]:
                cur -= 1
            if cur > i:
                cnt += cur - i
        cur2 = lp - 1
        for i in range(lp):
            while cur2 and posi[cur2] > m // posi[i]:
                cur2 -= 1
            if cur2 > i:
                cnt += cur2 - i
        if cnt >= k:
            r = m
        else:
            l = m
    print(r)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
posi = []
nega = []
zero = []
for i in range(n):
    if a[i] < 0:
        nega.append(a[i] * -1)
    elif a[i] > 0:
        posi.append(a[i])
    else:
        zero.append(a[i])
zero = len(zero)
posi.sort()
nega.sort()
lp, ln = len(posi), len(nega)
if k <= lp * ln:
    l, r = 0, 10 ** 18
    while r - l > 1:
        m = (l + r) // 2
        cnt = lp * ln
        cur = 0
        for i in range(ln)[::-1]:
            while cur < lp and posi[cur] < (m + nega[i] - 1) // nega[i]:
                cur += 1
            cnt -= cur
        if cnt >= k:
            l = m
        else:
            r = m
    print(-1 * l)
elif k <= n * (n - 1) // 2 - (lp * (lp - 1) // 2) - (ln * (ln - 1) // 2):
    print(0)
else:
    k -= n * (n - 1) // 2 - (lp * (lp - 1) // 2) - (ln * (ln - 1) // 2)
    l, r = 0, 10 ** 18
    while r - l > 1:
        m = (l + r) // 2
        cnt = 0
        cur = ln - 1
        for i in range(ln):
            while cur and nega[cur] > m // nega[i]:
                cur -= 1
            if cur > i:
                cnt += cur - i
        cur2 = lp - 1
        for i in range(lp):
            while cur2 and posi[cur2] > m // posi[i]:
                cur2 -= 1
            if cur2 > i:
                cnt += cur2 - i
        if cnt >= k:
            r = m
        else:
            l = m
    print(r)
Buggy python submission (verdict: Runtime Error):
n = input()[::-1]
dp = [[0, 0] for i in range(len(n) + 1)]
dp[0][1] = 1
for i in range(len(n)):
    dp[i + 1][0] = min(dp[i][0] + int(n[i]), dp[i][1] - int(n[i]) + 10)
    dp[i + 1][1] = min(dp[i][0] + int(n[1]) + 1, dp[i][1] - int(n[i]) + 9)
print(dp[len(n)][0])

Fixed submission:
n = input()[::-1]
dp = [[0, 0] for i in range(len(n) + 1)]
dp[0][1] = 1
for i in range(len(n)):
    dp[i + 1][0] = min(dp[i][0] + int(n[i]), dp[i][1] - int(n[i]) + 10)
    dp[i + 1][1] = min(dp[i][0] + int(n[i]) + 1, dp[i][1] - int(n[i]) + 9)
print(dp[len(n)][0])
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * (n + 1)
ans = []
for i in range(n):
    l[i + 1] = l[i] + (p[i] + 1) / 2
for i in range(n - k + 1):
    ans.append(l[i + k] - l[i])
print(max(ans))

Fixed submission:
input1 = input().split()
input2 = list(map(int,input().split()))
U = input()
S = input1[0]
T = input1[1]
A = input2[0]
B = input2[1]
if U == S:
  A -= 1
else:
  B -= 1
print(str(A) + " " + str(B))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * n
ans = []
l[0] = (p[0] + 1) / 2
for i in range(1, n):
    l[i] = l[i - 1] + (p[i] + 1) / 2
for i in range(n - k):
    ans.append(l[i + k] - l[i])
print(max(ans))

Fixed submission:
input1 = input().split()
input2 = list(map(int,input().split()))
U = input()
S = input1[0]
T = input1[1]
A = input2[0]
B = input2[1]
if U == S:
  A -= 1
else:
  B -= 1
print(str(A) + " " + str(B))
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * n
ans = []
l[0] = (p[0] + 1) / 2
for i in range(1, n):
    l[i] = l[i - 1] + (p[i] + 1) / 2
for i in range(n - k):
    ans.append(l[i + k] - l[i])
print(max(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * (n + 1)
ans = []
for i in range(n):
    l[i + 1] = l[i] + (p[i] + 1) / 2
for i in range(n - k + 1):
    ans.append(l[i + k] - l[i])
print(max(ans))

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * n
ans = []
l[0] = (p[0] + 1) / 2
for i in range(1, n):
    l[i] = l[i - 1] + (p[i] + 1) / 2
print(l)
for i in range(n - k):
    ans.append(l[i + k] - l[i])
print(max(ans))

Fixed submission:
n, k = map(int, input().split())
p = list(map(int, input().split()))
l = [0] * (n + 1)
ans = []
for i in range(n):
    l[i + 1] = l[i] + (p[i] + 1) / 2
for i in range(n - k + 1):
    ans.append(l[i + k] - l[i])
print(max(ans))
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10 ** 9 + 7
def comb(n, r):
    if n < r:return 0
    if n < 0 or r < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod
r1, c1, r2, c2 = map(int, input().split())
fa = [1] * (r2 + c2 + 3)
fi = [1] * (r2 + c2 + 3)
for i in range(1, r2 + c2 + 3):
    fa[i] = fa[i - 1] * i % mod
    fi[i] = pow(fa[i], mod - 2, mod)
def ans(r, c):
    return fa[r + c + 2] * fi[r + 1] * fi[c + 1] % mod - 1
print((ans(r2, c2) - ans(r2, c1 - 1) - ans(r1 - 1, c2) + ans(r1 - 1, c1 - 1)) % mod)

Fixed submission:
mod = 10 ** 9 + 7
def comb(n, r):
    if n < r:return 0
    if n < 0 or r < 0:return 0
    return fa[n] * fi[r] % mod * fi[n - r] % mod
r1, c1, r2, c2 = map(int, input().split())
fa = [1] * (r2 + c2 + 3)
fi = [1] * (r2 + c2 + 3)
for i in range(1, r2 + c2 + 3):
    fa[i] = fa[i - 1] * i % mod
    fi[i] = pow(fa[i], mod - 2, mod)
def ans(r, c):
    return fa[r + c + 2] * fi[r + 1] * fi[c + 1] % mod - 1
print((ans(r2, c2) - ans(r2, c1 - 1) - ans(r1 - 1, c2) + ans(r1 - 1, c1 - 1)) % mod)
Buggy python submission (verdict: Runtime Error):
h,a = map(int, input().split)
ans = 0
if h % a == 0:
  ans = h // a
else:
  ans = h // a + 1
print(ans)

Fixed submission:
h,a = map(int, input().split())
ans = 0
if h % a == 0:
  ans = h // a
else:
  ans = h // a + 1
print(ans)

Buggy python submission (verdict: Runtime Error):
h,a = int(input())
ans = 0
if h % a == 0:
  ans = h // a
else:
  ans = h // a + 1
print(ans)

Fixed submission:
h,a = map(int, input().split())
ans = 0
if h % a == 0:
  ans = h // a
else:
  ans = h // a + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
for i in range(k):
    h.remove(max(h))
print(sum(h))

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
h.reverse()
if k >= n:
    print(0)
else:
    del h[:k]
    print(sum(h))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
D = 1
if k != 0:
  while D <= k:
    if h == []:
      print(0)
      exit()
    else:
      h.remove(max(h))
    D += 1
print(sum(h))

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
h.reverse()
if k >= n:
    print(0)
else:
    del h[:k]
    print(sum(h))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
D = 1
if k != 0:
  while D <= k:
    if h == []:
      print(0)
      exit()
    else:
      h.remove(max(h))
      D += 1
sum1 = sum(h)
print(sum1)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
h.reverse()
if k >= n:
    print(0)
else:
    del h[:k]
    print(sum(h))

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
D = 1
if k != 0:
  while D <= k:
    if h == []:
      print(0)
      exit()
    else:
      h.remove(max(h))
      D += 1
sum1 = sum(h)
print(sum1)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
h.reverse()
if k >= n:
    print(0)
else:
    del h[:k]
    print(sum(h))
Buggy python submission (verdict: Time Limit Exceeded):
h, n = map(int, input().split())
a, b = [], []
for i in range(n):
    a_, b_  = map(int, input().split())
    a.append(a_)
    b.append(b_)
dp = [0] * (max(a) + h)
for i in range(1, max(a) + h):
    dp[i] = min(dp[i - a[j]] + b[j] for j in range(n))
print(min(dp[h:]))

Fixed submission:
h, n = map(int, input().split())
a, b = [], []
for i in range(n):
    a_, b_  = map(int, input().split())
    a.append(a_)
    b.append(b_)
dp = [0] * (max(a) + h)
for i in range(1, max(a) + h):
    dp[i] = min(dp[i - a[j]] + b[j] for j in range(n))
print(min(dp[h:]))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input())
if n == m:
  print("Yes")
else:
  print("No")

Fixed submission:
input_numbers = list(map(int,input().split()))
n = input_numbers[0]
m = input_numbers[1]
if n == m:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input())
ans = ""
if n == m:
  ans = "Yes"
else:
  ans = "No"
print(ans)

Fixed submission:
input_numbers = list(map(int,input().split()))
n = input_numbers[0]
m = input_numbers[1]
if n == m:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
input_numbers = list(map(int,input().split()))
a = input_numbers[0]
b = input_numbers[1]
A = a
B = b
x = 0
y = 0
while A >= 0:
  x += 10 ** A * b
  A -= 1
while B >= 0:
  y += 10 ** B * a
  B -= 1
if x > y:
  ptint(x)
else:
  print(y)

Fixed submission:
input_numbers = list(map(int,input().split()))
a = input_numbers[0]
b = input_numbers[1]
A = a
B = b
x = 0
y = 0
while A > 0:
  x += 10 ** (A-1) * b
  A -= 1
while B > 0:
  y += 10 ** (B-1) * a
  B -= 1
if x > y:
  print(x)
else:
  print(y)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n):
    if min(p[:i + 1]) == p[i]:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= m:
        cnt += 1
        m = p[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
l = []
for i in range(n):
    l.append(min(p[:i + 1]))
print(len(set(l)))

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= m:
        cnt += 1
        m = p[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
l = []
ans = 0
for i in p:
    l.append(i)
    if min(l) == i:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= m:
        cnt += 1
        m = p[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
l = []
ans = 0
for i in p:
    l.append(i)
    if min(l) == i:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= m:
        cnt += 1
        m = p[i]
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
l = []
ans = 0
for i in p:
    l.append(i)
    if min(l) == i:
        ans += 1
print(ans)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 1
m = p[0]
for i in range(1, n):
    if p[i] <= m:
        cnt += 1
        m = p[i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
n, k = map(int, input().split())
a = list(reversed(sorted(list(map(int, input().split())))))
mod = 10 ** 9 + 7
ans = 0
for i in range(n - 1):
    m = int(comb(n - i - 1, k - 1))
    ans += a[i] * m - a[n - i - 1] * m
    ans %= mod
print(ans)

Fixed submission:
mod = 10 ** 9 + 7
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
comb = [1] * (n - k + 1)
for i in range(n - k):
    comb[i + 1] = (comb[i] * (k + i) * pow(i + 1, mod - 2, mod)) % mod
ans = 0
for i in range(n - k + 1):
    ans = (ans + a[k + i - 1] * comb[i]) % mod
    ans = (ans - a[i] * comb[-1 - i]) % mod
print(ans)

Buggy python submission (verdict: Runtime Error):
from scipy.misc import comb
n, k = map(int, input().split())
a = list(reversed(sorted(list(map(int, input().split())))))
mod = 10 ** 9 + 7
ans = 0
for i in range(n - 1):
    m = int(comb(n - i - 1, k - 1))
    ans += a[i] * m - a[n - i - 1] * m
    ans %= mod
print(ans)

Fixed submission:
mod = 10 ** 9 + 7
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
comb = [1] * (n - k + 1)
for i in range(n - k):
    comb[i + 1] = (comb[i] * (k + i) * pow(i + 1, mod - 2, mod)) % mod
ans = 0
for i in range(n - k + 1):
    ans = (ans + a[k + i - 1] * comb[i]) % mod
    ans = (ans - a[i] * comb[-1 - i]) % mod
print(ans)

Buggy python submission (verdict: Runtime Error):
from math import comb
n, k = map(int, input().split())
a = list(reversed(sorted(list(map(int, input().split())))))
ma = 0
mi = 0
mod = 10 ** 9 + 7
for i in range(n - 1):
    ma += a[i] * comb(n - i - 1, k - 1)
    ma %= mod
a.reverse()
for i in range(n - 1):
    mi += a[i] * comb(n - i - 1, k - 1)
    mi %= mod
print(ma - mi)

Fixed submission:
mod = 10 ** 9 + 7
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
comb = [1] * (n - k + 1)
for i in range(n - k):
    comb[i + 1] = (comb[i] * (k + i) * pow(i + 1, mod - 2, mod)) % mod
ans = 0
for i in range(n - k + 1):
    ans = (ans + a[k + i - 1] * comb[i]) % mod
    ans = (ans - a[i] * comb[-1 - i]) % mod
print(ans)
Buggy python submission (verdict: Runtime Error):
input1 = list(map(int,input().split()))
K = input[0]
X = input[1]
if K * 500 >= X:
  print("Yes")
else:
  print("No")

Fixed submission:
input1 = list(map(int,input().split()))
K = input1[0]
X = input1[1]
if K * 500 >= X:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
print(count("ABC"))

Fixed submission:
n = int(input())
s = input()
print(s.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
list = [str(x) for x in S]
index = 0
abc = 0
for alphabet in list:
  if alphabet == "A" and list[index + 1] == "B" and list[index + 2] == "C":
    abc += 1
  index += 1
print(abc)

Fixed submission:
n = int(input())
s = input()
print(s.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
list = [str(x) for x in S]
index = 0
abc = 0
for alphabet in list:
  if alphabet == "A" and list[index + 1] == "B" and list[index + 2] == "C":
    abc += 1
  index += 1
if index != N - 1:
  break
print(abc)

Fixed submission:
n = int(input())
s = input()
print(s.count("ABC"))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
list = [str(x) for x in S]
index = 0
abc = 0
for alphabet in list:
  if alphabet == "A" and list[index + 1] == "B" and list[index + 2] == "C":
    abc += 1
  index += 1
print(abc)

Fixed submission:
n = int(input())
s = input()
print(s.count("ABC"))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
    else:
        pass
print(a, b)

Fixed submission:
a, b, k = map(int, input().split())
a1 = a
b1 = b
if k <= a:
    a1 -= k
elif k <= a + b:
    a1 = 0
    b1 -= k - a
else:
    a1 = 0
    b1 = 0
print(a1, b1)