Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03038 (python)

Fixed submission:
def main():
	N, M = [int(x) for x in input().split(" ")]
	A = [int(a) for a in input().split(" ")]
	A.sort()
	overwrite = []
	for i in range(M):
		B, C = [int(x) for x in input().split(" ")]
		overwrite.append({
			"count": B,
			"number": C
		})
	overwrite.sort(key=lambda o: -o["number"])
	j = 0
	k = 0
	flag = False
	while not flag and j < len(A) and k < len(overwrite):
		o = overwrite[k]
		for m in range(o["count"]):
			if j < len(A) and A[j] <= o["number"]:
				A[j] = o["number"]
				j += 1
			else:
				flag = True
		k += 1

	print(sum(A))

main()

Buggy submission (verdict: Runtime Error):
def main():
	N, M = [int(x) for x in input().split(" ")]
	A = [int(a) for a in input().split(" ")]
	A.sort()
	overwrite = []
	for i in range(M):
		B, C = [int(x) for x in input().split(" ")]
		overwrite.append({
			"count": B,
			"number": C
		})
	overwrite.sort(key=lambda o: -o["number"])
	j = 0
	k = 0
	flag = False
	while not flag and j < len(A) and k < len(overwrite):
		o = overwrite[k]
		for m in range(o["count"]):
			if A[j] <= o["number"]:
				A[j] = o["number"]
				j += 1
			else:
				flag = True
		k += 1

	print(sum(A))

main()
Problem p03041 (python)

Fixed submission:
small = ['a', 'b', 'c']
capital = ['A', 'B', 'C']
 
tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
str = list(input())
 
str[K - 1] = small[capital.index(str[K - 1])]
 
print("".join(str))

Buggy submission (verdict: Runtime Error):
small = ['a', 'b', 'c']
capital = ['A', 'B', 'C']

tmp = input().split(" ")
N = int(tmp[0])
K = int(tmp[1])
str = input()

str[K] = small[capital.index(str[K])]

print(str)
Problem p03073 (python)

Fixed submission:
s = input()
 
start0 = 0
start1 = 0
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] == "0":
      start1 += 1
    elif s[i] == "1":
      start0 += 1
  elif i % 2 == 1:
    if s[i] == "0":
      start0 += 1
    elif s[i] == "1":
      start1 += 1

print(min([start0, start1]))

Buggy submission (verdict: Runtime Error):
s = int(input())

start0 = 0
start1 = 0
for i in range(len(s)):
  if i % 2 == 0:
    if s[i] == "0":
      start1 += 1
    elif s[i] == "1":
      start0 += 1
  elif i % 2 == 1:
    if s[i] == "0":
      start0 += 1
    elif s[i] == "1":
      start1 += 1

print(min([start0, start1]))
Problem p03631 (python)

Fixed submission:
tmp = list(input())
print("Yes") if tmp[0] == tmp[2] else print("No")

Buggy submission (verdict: Runtime Error):
tmp = input().split(" ")
print("Yes") if tmp[0] == tmp[2] else print("No")
Problem p03803 (python)

Fixed submission:
tmp = input().split(" ")
a = (int(tmp[0]) - 2) % 13
b = (int(tmp[1]) - 2) % 13
print("Alice") if a > b else print("Draw") if a == b else print("Bob")

Buggy submission (verdict: Runtime Error):
tmp = input().split(" ")
a = (int(tmp[0]) - 2) % 13
b = (int(tmp[1]) - 2) % 13
print("Alice") if a > b else print("Draw") if a = b else print("Bob")
Problem p03834 (python)

Fixed submission:
print(input().replace(",", " "))

Buggy submission (verdict: Runtime Error):
print(input().replace(",", " ")
Problem p02829 (python)

Fixed submission:
# cook your dish here
n=int(input())
m=int(input())
if (n==1 and m==2) or (n==2 and m==1):
  print('3')
elif (n==1 and m==3) or (n==3 and m==1):
  print('2')
elif (n==3 and m==2) or (n==2 and m==3):
  print('1')

Buggy submission (verdict: Runtime Error):
n=int(input())
m=int(input())
if (n==1 and m==2) or (n==2 and m==1):
  print('3')
elif (n==1 and m==3) or (n==3 and m==1):
  print('2')
elif (n=3and m==2) or (n==2 and m==3):
  print('1')
Problem p02676 (python)

Fixed submission:
k = int(input())
s = input()
l = len(s)
if (l <= k):
    print(s)
else:
    print(s[:k] + "...")

Buggy submission (verdict: Runtime Error):
k = int(input())
s = input()
l = len(s)
if (k >= l):
    print(s)
else:
    print(s[:k] + "...")
Problem p02699 (python)

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

Buggy submission (verdict: Runtime Error):
S, W = map(int, input().split())
if S =< W:
    print("unsafe")
else:
    print("safe")
Problem p02711 (python)

Fixed submission:
N = int(input())
if "7" in str(N):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, N+1:
    for j in range(i + 1, N+1):
        for k in range(j + 1, N+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, len(S)+1):
    for j in range(i + 1, len(S)+1):
        for k in range(j + 1, len(S)+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, len(S)+1):
    for j in range(i + 1, len(S)+1):
        for k in range(j + 1, len(S)+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)
Problem p02723 (python)

Fixed submission:
S = input()
if S[2] != S[3] or S[4] != S[5]:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
l = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d=min(j-i,abs(X-i)+1+abs(Y-j),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for k in range(N-1):
    print(l[k])

Buggy submission (verdict: Runtime Error):
n,x,y = map(int,input().split())
m = {}
for i in range(1,n):
    m[i] = 0
for i in range(1,n):
    for j in range(i+1,n+1):
        dif = min(abs(j-i),(abs(x-i)+1+abs(j-y)),(abs(y-i)+1+abs(j-x)))
        m[dif]+=1
[print(m[i]) for i in range(1,n)]

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
l = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d=min(j-i,abs(X-i)+1+abs(Y-j),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for k in range(N-1):
    print(l[k])

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
l = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d=min(j-i,abs(X-i)+1+abs(Y-j),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for a in l:
    print(a)
Problem p02729 (python)

Fixed submission:
from itertools import combinations
n, m = map(int, input().split())
r = []
i = 0
j = -1
c = 0
for _ in range(n):
    i += 2
    r.append(i)
for _ in range(m):
    j += 2
    r.append(j)
r.sort()
for k in list(combinations(r, 2)):
    if sum(k) % 2 == 0:
        c += 1

print(c)

Buggy submission (verdict: Runtime Error):
S = input()
N = len(S)
if S == S[::-1] and S[:(N - 1)//2][::-1] == S[:(N - 1)//2] and S[(N + 3)//2][::-1] == S[(N + 3)//2]:
    print("Yes")
else:
    print("No")
Problem p02785 (python)

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

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
if h == 0:
  print(sum(h))
elif h >= n:
  print(0)
else:
  h.sort()
  print(sum(h[:n-k]))
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
a, b = map(int, input().split())
print(int(a * b / gcd(a, b)))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
gcd = math.gcd(a, b)
ans = a*b/gcd
print(int(ans))

Buggy submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(int(a*b/math.gcd(a, b)))
Problem p02879 (python)

Fixed submission:
a, b = map(int, input().split())
print(-1 if a not in range(1, 10) or b not in range(1, 10) else a*b)

Buggy submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')
Problem p02880 (python)

Fixed submission:
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')

Buggy submission (verdict: Runtime Error):
 = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')
Problem p02831 (python)

Fixed submission:
import fractions

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(A, B))

Buggy submission (verdict: Runtime Error):
import math

A, B = map(int, input().split())


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(A, B))
Problem p02880 (python)

Fixed submission:
k = int(input())
for i in range(1,10):
    if k // i <= 9 and k % i == 0:
       print("Yes")
       exit()
     
print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
for i in range(1,10):
     if k // i <= 9 and k % i == 0:
            print("Yes")
        	exit
     
print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
for i in range(1,10):
     if k // i <= 9 and k % i == 0:
            print("Yes")
        	exit()
     
print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
a = list(range(1,10))
for i in a:
     if k in / i >= 10:
             print("No")
     else:
             print("Yes")

Buggy submission (verdict: Runtime Error):
k = int(input())

for i in list(range(1,10)):
     if k in / i >= 10:
             print("No")
     else:
             print("Yes")

Buggy submission (verdict: Runtime Error):
in = int(input())
for i in list(range(1,10)):
     if in / i >= 10:
             print("No")
     else:
             print("Yes")

Buggy submission (verdict: Runtime Error):
in = int(input())
for i in list(range(10)):
     if in / i >= 10:
             print("No")
     else:
             print("Yes")
Problem p03775 (python)

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    # divisors.sort()
    return divisors


N = int(input())
r = make_divisors(N)
res = []
for i in r:
    y = N // i
    res.append(max(len(str(y)), len(str(i))))
print(min(res))

Buggy submission (verdict: Runtime Error):
for A in range(1, int((N / 2))):
    if N % A == 0:
        B = int(N / A)
        if len(str(A)) <= len(str(B)):
            res = len(str(B))
        elif len(str(A)) >= len(str(B)):
            res = len(str(A))
        cont.append(res)
    else:
        continue
print(min(cont))
Problem p02682 (python)

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

left = k
sum = 0
cards = (a, b, c)

for i, card in enumerate(cards):
  if card <= left:
    sum += card * (1-i)
    left -= card
  elif left > 0:
    sum += left * (1-i)
    left = 0

print(sum)

Buggy submission (verdict: Runtime Error):
a, b, c, k = list(map(int, input().split()))

cards = [1]*a + [0]*b + [-1]*c
print(sum(cards[:k]))
Problem p02862 (python)

Fixed submission:
p = 10**9+7
def nCr(n,r):
    if r*2>n:
        return nCr(n,n-r)
    else:
        a = b = 1
        for i in range(r):
            a = a * (n - i) % p
            b = b * (r - i) % p
        return (a * pow(b,p-2,p)) % p

x, y = map(int, input().split())

if (2*x-y) % 3 == 0 and (2*y-x) % 3 == 0 and (2*x-y)>=0 and (2*y-x)>=0:
    b = (2*x-y)//3
    a = x-2*b
else:
    print(0)
    exit()

print(int(nCr(a+b, a)))

Buggy submission (verdict: Runtime Error):
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

x, y = map(int, input().split())

if (2*x-y) % 3 == 0:
    b = (2*x-y)/3
    a = x-2*b
    if a<0:
        print(0)
        exit()
else:
    print(0)
    exit()

print(int(comb(a+b, a)%(1e9+7)))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

x, y = map(int, input().split())

if (2*x-y) % 3 == 0:
    b = (2*x-y)/3
    a = x-2*b
    if a<0:
        print(0)
        exit()
else:
    print(0)
    exit()

print(int(comb(a+b, a, exact=True)%(1e9+7)))
Problem p02623 (python)

Fixed submission:
N, M, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

A = [0]
B = [0]
for i in range(len(a)):
    A.append(A[i] + a[i])
for i in range(len(b)):
    B.append(B[i] + b[i])

ans = 0
j = len(B) - 1
for i in range(len(A)):
    if A[i] > K:
        break
    while A[i] + B[j] > K:
        j -= 1
    ans = max(ans, i + j)
print(ans)

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

A = list(map(int, input().split()))
B = list(map(int, input().split()))

i = 0
a = 0
b = 0
time = 0
while True:
    i += 1
    if len(A) == 0:
        time += B[b]
        b += 1
    elif len(B) == 0:
        time += A[a]
        a += 1
    else:
        if A[a] <= B[b]:
            time += A[a]
            a += 1
        elif A[a] > B[b]:
            time += B[b]
            b += 1
    if K < time:
        print(i - 1)
        exit()
    elif len(A) == 0 and len(B) == 0:
        print(i)
        exit()
Problem p02880 (python)

Fixed submission:
N = int(input())

if N > 81 or N == 0:
    print("No")
    exit()

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            print("Yes")
            exit()
print("No")

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

if N > 81 or N == 0:
    print("No")
    exit()

for i in range(1, 10):
    for j in range(1, 10):
        if i * j == N:
            print("Yes")
            eixt()
print("No")
Problem p02580 (python)

Fixed submission:
H, W, M = map(int, input().split())
target = []
Height = [0] * H
Width = [0] * W
for m in range(M):
  h, w = map(lambda x: int(x)-1, input().split())
  target.append((h, w))
  Height[h] += 1
  Width[w] += 1
max_H, max_W = max(Height), max(Width)

cH, cW = 0, 0
for i in range(H):
  if Height[i] == max_H:
    cH +=1
for i in range(W):
  if Width[i] == max_W:
    cW +=1
max_cross = cH * cW

double_count = 0
for h, w in target:
  if Height[h] == max_H and Width[w] == max_W:
    double_count += 1

if double_count == max_cross:
  print(max_H + max_W - 1)
else:
  print(max_H + max_W)

Buggy submission (verdict: Runtime Error):
H, W, M = map(int, input().split())
bomb = [[0] * W for _ in range(H)]
Height = [0] * H
Width = [0] * W
for m in range(M):
  h, w = map(lambda x:int(x)-1, input().split())
  bomb[h][w] += 1
  Height[h] += 1
  Width[w] += 1
max_H, max_W = max(Height), max(Width)
cH, cW = [], []
for i in range(H):
  if Height[i] == max_H:
    cH.append(i)
for i in range(W):
  if Width[i] == max_W:
    cW.append(i)

dont_sub = 0
for idx_h in cH:
  for idx_w in cW:
    if bomb[idx_h][idx_w] == 0:
      dont_sub = 1
      break
  if dont_sub == 1:
    break
if dont_sub == 0:
  print(max_H + max_W - 1)
else:
  print(max_H + max_W)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

print(s if a >= 3200 else 'red')

Buggy submission (verdict: Runtime Error):
a = input()
s= input()

if a >= 3200:
  print(s)
else:
  print('red')
Problem p03307 (python)

Fixed submission:
N = int(input())

if (N % 2 == 0):
    print(N)
else:
    print(2*N)

Buggy submission (verdict: Runtime Error):
import copy

N = int(input())
An = list(map(int, input().split()))
for n in range(N):
    An[n] -= (n+1)

An.sort()

if (N % 2 == 0):
    cent = An[N//2 - 1] + An[N//2] // 2
else:
    cent = An[(N-1)//2]

ans = sum(An) - N * cent

print(ans)
Problem p03803 (python)

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

if A == 1:
    A += 13
if B == 1:
    B += 13

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())

if A = 1:
    A += 12
if B = 1:
    B += 12

if A < B:
    print('Alice')
if A > B:
    print('Bob')
else:
    print('Draw')

Buggy submission (verdict: Runtime Error):
A, B = map(int, input())

if A < B:
    print('Alice')
if A > B:
    print('Bob')
else:
    print('Draw')
Problem p02777 (python)

Fixed submission:
from sys import stdin

s, t = stdin.readline().rstrip().split()
a, b = [int(x) for x in stdin.readline().rstrip().split()]
u = input()

if (u in s):
    print(str(a - 1) + ' ' + str(b))
elif (u in t):
    print(str(a) + ' ' + str(b - 1))
else:
    print(str(a) + ' ' + str(b))

Buggy submission (verdict: Runtime Error):
s = input.split()
a, b = map(int, input.split())
u = input()

if(u in s[0]):
    print(str(a - 1) + ' ' + str(b))
elif(u in s[1]):
    print(str(a) + ' ' + str(b - 1))
else:
    print(str(a) + ' ' + str(b))
Problem p02627 (python)

Fixed submission:
str = input()

if str.islower():
	print("a")
else:
    print("A")

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

P.sort()

ans = 0
for i in range(K):
    ans += P[i]
    
print(ans)
Problem p02754 (python)

Fixed submission:
N, A, B = [int(v) for v in input().strip().split(" ")]

loop, m = divmod(N, A + B)
print(loop * A + (m if m < A else A))

Buggy submission (verdict: Runtime Error):
N, A, B = [int(v) for v in input().strip().split(" ")]

pair = A + B
loop = (N // (A+B)) + 1
message = ''
for _ in range(loop):
    message += 'b' * A + 'r' * B
print(message[0:N].count('b'))

Buggy submission (verdict: Runtime Error):
N, A, B = [int(v) for v in input().strip().split(" ")]

items = []
while len(items) < N:
     items.append('b' * A)
     items.append('r' * B)

print(items.count("b"))
Problem p03011 (python)

Fixed submission:

def solve():
    P, Q, R = [int(_) for _ in raw_input().split()]
    ret = min(P+Q, Q+R, P+R)
    print ret

if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
from collections import deque

def solve():
    H, W = [int(_) for _ in raw_input().split()]
    S = []
    for i in range(H):
        Si = [_ for _ in raw_input()]
        S.append(Si)
    rowm = [None] * H
    for i in range(H):
        start = -1
        end = 0
        save = (start, end, i)
        for j in range(W):
            if S[i][j] == '.':
                end = j
            else:
                start = j
                end = j
            if end - start > save[1] - save[0]:
                save = (start, end, i)
        rowm[i] = save
    colm = [None] * W
    for j in range(W):
        start = -1
        end = 0
        save = (start, end, j)
        for i in range(H):
            if S[i][j] == '.':
                end = i
            else:
                start = i
                end = i
            if end - start > save[1] - save[0]:
                save = (start, end, j)
        colm[j] = save
    rowm.sort(key = lambda x: x[1] - x[0], reverse = True)
    colm.sort(key = lambda x: x[1] - x[0], reverse = True)
    def max_ans(i,j):
        s1, e1, row = rowm[i]
        s2, e2, col = colm[j]
        return e1 - s1 + e2 - s2 - 1
    # priority queue
    ij_set = set()
    ij_set.add((0, 0))
    queue = deque()
    queue.append((max_ans(0, 0), 0,0))
    def AddToQueue(_ele):
        if len(queue) == 0:
            queue.append(_ele)
        else:
            cnt = 0
            while cnt < len(queue) and queue[cnt][0] >= _ele[0]:
                cnt += 1
            ij = (_ele[1], _ele[2])
            if not (ij in ij_set):
                queue.insert(cnt, _ele)
                ij_set.add(ij)
    ret = 1
    while len(queue) > 0:
        ans, i, j = queue.popleft()
        s1, e1, row = rowm[i]
        s2, e2, col = colm[j]
        if ans == 1:
            ret = ans
            break
        if row >= s2 and row <=e2 and col >= s1 and col <= e1:
            ret = ans
            break
        if i + 1 < H:
            AddToQueue((max_ans(i+1,j), i+1, j))
        if j + 1 < W:
            AddToQueue((max_ans(i,j+1), i, j+1))
    print ret

if __name__ == '__main__':
    solve()
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
d = []
A = []
s = [1] * N
for k in range(K):
  d.append(int(input()))
  A.append([int(i) for i in input().split()])
  
for k in range(K):
  for n in range(1, N+1):
    if n in A[k]:
      if s[n-1] == 1:
        s[n-1] = 0
print(sum(s))

Buggy submission (verdict: Runtime Error):
n = input().split()
N = int(n[0])
K = int(n[1])
s = [list(map(int, input().split())) for i in range(2*K+1)] 
b = list(range(N))
for l in b:
    for i in range(K):
        di = s[2*i]
        ai = s[2*i+1]
        for k in ai:
            if k == l:
                b.remove(l)
                ai.remove(l)
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =list(range(0,N-1))
for i in range(K):
    di = int(a[2*i+1])
    bi = a[2*i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
            	b.remove(l)
                bi.remove(l)
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =list(range(0,N-1))
for i in range(K):
    di = int(a[2i+1])
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
            	b.remove(l)
                bi.remove(l)
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = int(a0[0])
K = int(a0[1])
b =[]
for i in range(K):
    di = int(a[2i+1])
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if not bi[k] == l:
            	b.append(l)
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = a0[0]
K = a0[1]
b = []
for i in range(K):
    di = a[2i+1]
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if not bi[k] == l:
            	b.append(l)
print(len(b))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(list(map(int, input().split())))
a0 = a[0]
N = a0[0]
K = a0[1]
b = []
for i in range(K):
    di = a[2i+1]
    bi = a[2i+2]
for l in range(N):
    for i in range(K):
        for k in range(di):
            if bi[k] == l:
                b.append(l)
print(len(b))
Problem p02726 (python)

Fixed submission:
N, X, Y = map(int, input().split())
c = [0 for i in range(N)]
for i in range(1,N):
  for j in range(i+1,N+1):
    x = abs(X-i)
    y = abs(Y-j)
    a = min(x+y+1,j-i)
    c[a]+=1

for i in range(1,N):
  ans = c[i]
  print(ans)

Buggy submission (verdict: Runtime Error):
N, X, Y = map(int, input().split())
c = [0 for i in range(N)]
print(c)
for i in range(1,N):
  for j in range(i+1,N+1):
    x = abs(X-i)
    y = abs(Y-j)
    a = min(x+y+1,j-i)
    c[a]+=1

for i in range(1,N+1):
  ans = c[i]
  print(ans)
Problem p02881 (python)

Fixed submission:
N = int(input())
s = N+1
import math
m = int(math.sqrt(N))+1
for i in range(1,m):
  if N%i==0:
    a = i
    b = N/a
    s = min(a+b, s)
print(int(s)-2)

Buggy submission (verdict: Runtime Error):
N = int(input())
import math
n = int(math.sqrt(N))
s = 0
for i in range(1,n):
  if N%i == 0 and i > s:
    s = i
    
p = int(s+N/s-2)
print(p)