Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):

def aaa(seat_list):
	return seat_list[len(seat_list)-1] - seat_list[0]+1

value = int(input())
people = 0
# while True:
# 	try:
# 		seat = input()
# 		if seat:
# 			string_seat = seat.split()
# 			seat_list = []
# 			seat_list = [int(x) for x in (string_seat)]
# 			people += aaa(seat_list)
# 	except EOFError:
# 		break
while True:
	seat = input()
	if seat:
		string_seat = seat.split()
		seat_list = []
		seat_list = [int(x) for x in (string_seat)]
		people += aaa(seat_list)
		print(people)
	else:
		break
print(people)


Fixed submission:
value = int(input())
people = 0
while True:
	try:
		seat = input()
		if seat:
			string_seat = seat.split()
			seat_list = []
			seat_list = [int(x) for x in (string_seat)]
			people += seat_list[len(seat_list)-1] - seat_list[0]+1
	except EOFError:
		break
# while True:
# 	seat = input()
# 	if seat:
# 		string_seat = seat.split()
# 		seat_list = []
# 		seat_list = [int(x) for x in (string_seat)]
# 		people += aaa(seat_list)
# 	else:
# 		break
print(people)

Buggy python submission (verdict: Runtime Error):


def aaa(seat_list):
	return seat_list[len(seat_list)-1] - seat_list[0]

value = int(input())

people = 0
while True:
	try:
		seat = input()
		if seat:
			string_seat = seat.split()
			seat_list = []
			seat_list = [int(x) for x in (string_seat)]
			people += aaa(seat_list)
		except EOFError:
		break
print(people)


Fixed submission:
value = int(input())
people = 0
while True:
	try:
		seat = input()
		if seat:
			string_seat = seat.split()
			seat_list = []
			seat_list = [int(x) for x in (string_seat)]
			people += seat_list[len(seat_list)-1] - seat_list[0]+1
	except EOFError:
		break
# while True:
# 	seat = input()
# 	if seat:
# 		string_seat = seat.split()
# 		seat_list = []
# 		seat_list = [int(x) for x in (string_seat)]
# 		people += aaa(seat_list)
# 	else:
# 		break
print(people)

Buggy python submission (verdict: Runtime Error):


def aaa(seat_list):
	return seat_list[len(seat_list)-1] - seat_list[0]

value = int(input())

people = 0
# while True:
# 	try:
# 		seat = input()
# 		seat_list.append(int(seat.split(" "))
# 	except EOFError:
# 		break
while True:
	seat = input()
	if seat:
		string_seat = seat.split()
		seat_list = []
		seat_list = [int(x) for x in (string_seat)]
		people += aaa(seat_list)
	else:
		break

print(people)


Fixed submission:
value = int(input())
people = 0
while True:
	try:
		seat = input()
		if seat:
			string_seat = seat.split()
			seat_list = []
			seat_list = [int(x) for x in (string_seat)]
			people += seat_list[len(seat_list)-1] - seat_list[0]+1
	except EOFError:
		break
# while True:
# 	seat = input()
# 	if seat:
# 		string_seat = seat.split()
# 		seat_list = []
# 		seat_list = [int(x) for x in (string_seat)]
# 		people += aaa(seat_list)
# 	else:
# 		break
print(people)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
 
N, M, R = map(int, input().split())
r = [a-1 for a in [int(x) for x in input().split()]]
d = [[float("inf")]*N for _ in range(N)]

for i in range(M):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    d[a][b] = c
    d[b][a] = c

for a in range(N):
    d[a][a] = 0

res = float("inf")

for k in range(N):
    for i in range(N):
        for j in range(N):
            if d[i][k]+d[k][j] < d[i][j]:
                d[i][j] = d[i][k]+d[k][j]

for p in permutations(r):
    distance = 0
    for i in range(len(p)-1):
        distance += d[p[i]][p[i+1]]
    res = min(distance, res)

print(res)



Fixed submission:
from itertools import permutations
 
N, M, R = map(int, input().split())
r = [a-1 for a in [int(x) for x in input().split()]]
d = [[float("inf")]*N for _ in range(N)]

for i in range(M):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    d[a][b] = c
    d[b][a] = c

for a in range(N):
    d[a][a] = 0

res = float("inf")

for k in range(N):
    for i in range(N):
        for j in range(N):
            if d[i][k]+d[k][j] < d[i][j]:
                d[i][j] = d[i][k]+d[k][j]

for p in permutations(r):
    distance = 0
    for i in range(len(p)-1):
        distance += d[p[i]][p[i+1]]
    res = min(distance, res)

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
num = int(input())
val = [int(x) for x in input().split()]
res_val = []
for i in val:
    res_val.append(i-1)
    res_val.append(i)
    res_val.append(i+1)

set_val = set(res_val)

res = 0
for j in set_val:
    if res < res_val.count(j):
        res = res_val.count(j)
print(res)

Fixed submission:
num = int(input())
val = [int(x) for x in input().split()]

numbers = [int(x) for x in range(-1, 100001)]
numbers_dict = dict()

for number in numbers:
    numbers_dict[number] = numbers_dict.get(number, 0) + 1

for i in val:
    numbers_dict[i - 1] += 1
    numbers_dict[i] += 1
    numbers_dict[i + 1] += 1

print(max(numbers_dict.values())-1)
Buggy python submission (verdict: Time Limit Exceeded):
array = [2,4,8,16,32,64]

num = int(input())
while num not in array:
     num -= 1
print(num)

Fixed submission:
array = [2,4,8,16,32,64]

num = int(input())
while num not in array:
    if num == 1:
        break
    else:
        num -= 1
print(num)
Buggy python submission (verdict: Runtime Error):
import math

num = int(input())

cards = [int(x) for x in input().split()]

res = sum(cards)
res2 = 0

judge = math.inf
if num == 2:
    judge = abs(cards[0]-cards[1])
else:
    for i in cards:
        res -= i
        res2 += i
        div = abs(res - res2)
        judge = div if div < judge else judge

print(judge)

Fixed submission:
num = [int(x) for x in input().split()]
if num[0] %3 == 0 or num[1] % 3 == 0 or (num[0]+num[1]) %3 == 0:
    print("Possible")
else:
    print("Impossible")
Buggy python submission (verdict: Runtime Error):
import math

num = int(input())

cards = [int(x) for x in input().split()]

res = sum(cards)
res2 = 0

judge = math.inf
if num == 2:
    judge = abs(cards[0]-cards[1])
else:
    for i in cards:
        res -= i
        res2 += i
        div = abs(res - res2)
        judge = div if div < judge else judge

print(judge)

Fixed submission:

num = int(input())

cards = [int(x) for x in input().split()]

res = sum(cards)
res2 = 0

judge = float("inf")

if num == 2:
    judge = abs(cards[0]-cards[1])
else:
    for i in range(0, len(cards)):
        res -= cards[i]
        res2 += cards[i]
        div = abs(res - res2)
        judge = div if div < judge and i != len(cards)-1 else judge

print(judge)

Buggy python submission (verdict: Runtime Error):
import math

num = int(input())

cards = [int(x) for x in input().split()]

res = sum(cards)
res2 = 0

judge = math.inf
if num == 2:
    judge = abs(cards[0]-cards[1])
else:
    for i in cards:
        res -= i
        res2 += i
        div = abs(res - res2)
        judge = div if div < judge else judge

print(judge)

Fixed submission:

num = int(input())

cards = [int(x) for x in input().split()]

res = sum(cards)
res2 = 0

judge = float("inf")

if num == 2:
    judge = abs(cards[0]-cards[1])
else:
    for i in range(0, len(cards)):
        res -= cards[i]
        res2 += cards[i]
        div = abs(res - res2)
        judge = div if div < judge and i != len(cards)-1 else judge

print(judge)
Buggy python submission (verdict: Time Limit Exceeded):
num = int(input())
array = [int(x) for x in input().split()]

res = []
for i in range(0, num):
    if i % 2 == 0:
        res.append(array[i])
    else:
        res.insert(0, array[i])

if num % 2 == 0:
    res = map(str, res)
    print(" ".join(res))
else:
    res = map(str, res[::-1])
    print(" ".join(res))


Fixed submission:
import math

num = int(input())
array = [int(x) for x in input().split()]

zero_array = array[0::2]
one_array = array[1::2]

if num % 2 == 0:
    one_array = one_array[:int(num/2)]
    pick = one_array[::-1] + zero_array[:int(num/2)]
else:
    one_array = one_array[:int(num/2)]
    pick= one_array[::-1] + zero_array[:math.ceil(num/2)]

if num % 2 == 0:
    print(" ".join(map(str, pick)))
else:
    print(" ".join(map(str, pick[::-1])))
Buggy python submission (verdict: Runtime Error):


num = int(input())

array = []
for i in range(num):
    array.append(int(input()))

res = -1
if 2 in array:
    judge = array[0]
    roop = 1
    while judge != 2 and roop != 100001:
        roop += 1
        judge = array[judge-1]
        if judge == 2:
            break
if judge == 2:
    res = roop

print(res)

Fixed submission:


num = int(input())

array = []
for i in range(num):
    array.append(int(input()))

res = -1
if 2 in array:
    judge = array[0]
    roop = 1
    while judge != 2 and roop != 100001:
        roop += 1
        judge = array[judge-1]
        if judge == 2:
            break
else:
    judge = 10000000

if judge == 2:
    res = roop

print(res)
Buggy python submission (verdict: Runtime Error):
num = int(input())

array = []
for i in range(num):
    array.append(int(input()))

point_max = sum(array)
tmp_max = point_max

array_sort = sorted(array)

if point_max % 10 != 0:
    print(point_max)
else:
    for i in array_sort:
        point_max -= i
        if point_max % 10 != 0:
            res = point_max
            break
        else:
            point_max += i
    print(0 if point_max == tmp_max else point_max)



Fixed submission:
num = [int(x) for x in input().split()]
print(sum(num) if sum(num) < 10 else "error")
Buggy python submission (verdict: Runtime Error):
/Users/miyauchitoru/Python_Competitive-programming/bin/python "/Users/miyauchitoru/PycharmProjects/Competitive_Programming/AtCorder/AtCoder Beginner Contest 077/compe.py"
123456789012345678901234567890
234567890123456789012345678901
LESS

Process finished with exit code 0


Fixed submission:
val =[]
val.append(int(input()))
val.append(int(input()))

if val[1] == val[0]:
    print("EQUAL")
elif val[0] > val[1]:
    print("GREATER")
else:
    print("LESS")
Buggy python submission (verdict: Runtime Error):
n = int(input())
array = [int(x) for x in input().split()]

cnt = 1
tmp = array.pop(0)
tmp2 = array.pop(0)
mode = "plus" if tmp2 > tmp else "minus" if tmp2 != tmp else "equal"
tmp = tmp2

for i in array:
    if tmp < i:
        if mode == "minus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "plus"
    elif tmp > i:
        if mode == "plus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "minus"
    tmp = i
print(cnt)

Fixed submission:
import sys

n = int(input())
array = [int(x) for x in input().split()]

cnt = 1
if n ==1:
    print(cnt)
    exit()

tmp = array.pop(0)
tmp2 = array.pop(0)
mode = "plus" if tmp2 > tmp else "minus" if tmp2 != tmp else "equal"
tmp = tmp2

for i in array:
    if tmp < i:
        if mode == "minus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "plus"
    elif tmp > i:
        if mode == "plus":
            cnt += 1
            mode = "equal"
        elif mode == "equal":
            mode = "minus"
    tmp = i
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())

res = 0
for i in range(n):
    if m-2 > 0:
        m -= 2
        res += 1
    else:
        break

print(res+m//4)

Fixed submission:
n, m = map(int, input().split())

res = 0
pair_m = m//2
if pair_m >= n:
    print(n + (m-n*2)//4)
else:
    print(pair_m)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().spllit())
tmp = abs(n)-abs(m)
print(tmp if (n <= 0 and m <= 0) or  (n >= 0 and m >= 0) else tmp+1)


Fixed submission:
x, y = map(int, input().split())
tmp = abs(abs(x) - abs(y))
if (y == 0 and 0 < x) or (x == 0 and y < 0):
    print(tmp + 1)
elif 0 <= x * y and x <= y:
    print(tmp)
elif 0 <= x * y and y < x:
    print(tmp + 2)
else:
    print(tmp + 1)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().spllit())
tmp = abs(n)-abs(m)
print(tmp if (n <= 0 and m <= 0) or  (n >= 0 and m >= 0) else tmp+1

Fixed submission:
x, y = map(int, input().split())
tmp = abs(abs(x) - abs(y))
if (y == 0 and 0 < x) or (x == 0 and y < 0):
    print(tmp + 1)
elif 0 <= x * y and x <= y:
    print(tmp)
elif 0 <= x * y and y < x:
    print(tmp + 2)
else:
    print(tmp + 1)
Buggy python submission (verdict: Runtime Error):
val = input().split()
if val[1] == "+":
    print(int(val[0]+int(val[2])))
else:
    print(int(val[0] - int(val[2])))

Fixed submission:
val = input().split()
if val[1] == "+":
    print(int(val[0])+int(val[2]))
else:
    print(int(val[0]) - int(val[2]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

array = [[int(x) for x in input().split()] for x in range(n)]

taka = array[0][0]
ao = array[0][1]

for item in array[1:]:
    taka_tmp = item[0]
    ao_tmp = item[1]

    cnt = 1
    while True:
        if taka_tmp*cnt >= taka and ao_tmp*cnt >= ao:
            taka = taka_tmp*cnt
            ao = ao_tmp*cnt
            break
        cnt += 1
print(ao+taka)

Fixed submission:
from decimal import Decimal, ROUND_CEILING

n = int(input())
ta_array = [[int(x) for x in input().split()] for y in range(n)]
res = 1
prev_t, prev_a = ta_array.pop(0)
for t, a in ta_array:
    res_a = Decimal(prev_a*res/a).quantize(Decimal(0.0), rounding=ROUND_CEILING)
    res_t = Decimal(prev_t*res/t).quantize(Decimal(0.0), rounding=ROUND_CEILING)
    res = max(res_a, res_t)
    prev_t = t
    prev_a = a
print(prev_t*res+prev_a*res)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a_array = [int(x) for x in input().split()]
sum_a = sum(a_array)
if sum_a % 2 == 0:
    sum_a = int(sum_a/len(a_array))
    ans = 0
    for a in a_array:
        ans += abs(sum_a-a)**2
    print(sum_a)
    print(int(ans))
else:
    sum_a1 = int(sum_a/len(a_array))
    sum_a2 = int(sum_a/len(a_array))+1
    ans1 = 0
    ans2 = 0
    for a in a_array:
        ans1 += abs(sum_a1-a)**2
        ans2 += abs(sum_a2-a)**2
    print(int(min(ans1, ans2)))

n = int(input())
a_array = [int(x) for x in input().split()]
ans = float("inf")
for i in range(-100, 101):
    tmp = 0
    for a in a_array:
        tmp += abs(a-i)**2
    ans = min(ans, tmp)
print(ans)

Fixed submission:
num = int(input())

val = [int(x) for x in input().split()]

val2 = [int(x) for x in range(min(val), max(val))]


array = []
for i in val2:
    res = 0
    for j in val:
        res += pow(abs(i - j), 2)
    array.append(res)
print(min(array) if len(array) != 0 else 0)
Buggy python submission (verdict: Runtime Error):
import itertools

n, k = map(int, input().split())
array = {x for x in input().split()}
num_array = {str(x) for x in range(10)}
like_num = array^num_array

res = float("inf")
for i in range(1, 100000):
    tmp = set(list(str(i)))
    if tmp.issubset(like_num):
        if n <= i < res:
            res = i
print(res)

Fixed submission:
a,b,c = map(int, input().split())
sum = [a, b, c]
if sum.count(5) == 2 and sum.count(7) == 1:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
array = sorted([input() for x in range(l)])

res = ""
for i in array:
    res += i

print(res)


Fixed submission:
n, l = map(int, input().split())

array = []
for i in range(n):
    array.append(input())
sort_array = sorted(array)
print("".join(sort_array))
Buggy python submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, k;

    cin >> n >> k;
    vector<int>d_vec(k, 0);
    for (int i = 0; i < k; ++i) {
        cin >> d_vec[i];
    }

    int price = n;
    while (true){
        bool isValid = true;
        int digit_cnt = floor(log10(price));
        int now = price;
        for (int digit = 0; digit < digit_cnt+1; ++digit) {
            int tmp = now % 10;
            auto iter = find(d_vec.begin(), d_vec.end(), tmp);
            if (iter != d_vec.end()){
                isValid = false;
                break;
            }
            now /= 10;
        }

        if (isValid){
            cout << price << endl;
            break;
        }


        price++;
    }
    return 0;


Fixed submission:
import itertools, math

n, k = input().split()
nums = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"} - {x for x in input().split()}
length = len(n)
coms = itertools.product(nums, repeat=length)
n = int(n)
ans = float("inf")
for com in coms:
    tmp = "".join(com)
    if n <= int(tmp) < ans:
        ans = int(tmp)

coms = itertools.product(nums, repeat=length+1)
for com in coms:
    tmp = "".join(com)
    if n <= int(tmp) < ans:
        ans = int(tmp)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
class Gcd:

    def __init__(self, K):
        self.table = [[None] * K for i in range(K)]
        return

    def gcd(self, x, y):
        if self.table[x - 1][y - 1] is not None:
            return self.table[x - 1][y - 1]

        if x == y:
            self.table[x - 1][y - 1] = x
            return x
        elif x > y:
            z = x % y
            if z == 0:
                self.table[x - 1][y - 1] = y
                return y
            else:
                z = self.gcd(z, y)
                self.table[x - 1][y - 1] = z
                return z
        else:
            return self.gcd(y, x)

def quest_c():
    K = int(input())

    gcd = Gcd(K)
    sum = 0
    for a in range(1, K + 1):
        for b in range(1, K + 1):
            d = gcd.gcd(a, b)
            for c in range(1, K + 1):
                sum += gcd.gcd(d, c)
    print(sum)

if __name__ == '__main__':
    quest_c()

Fixed submission:
class Gcd:

    def __init__(self, K):
        self.table = [[None] * K for i in range(K)]
        return

    def gcd(self, x, y):
        if self.table[x - 1][y - 1] is not None:
            return self.table[x - 1][y - 1]

        if x == y:
            self.table[x - 1][y - 1] = x
            return x
        elif x > y:
            z = x % y
            if z == 0:
                self.table[x - 1][y - 1] = y
                return y
            else:
                z = self.gcd(z, y)
                self.table[x - 1][y - 1] = z
                return z
        else:
            return self.gcd(y, x)

def quest_c():
    K = int(input())

    gcd = Gcd(K)
    sum = 0
    for a in range(1, K + 1):
        for b in range(1, K + 1):
            d = gcd.gcd(a, b)
            if d == 1:
                sum += K
            else:
                for c in range(1, K + 1):
                    sum += gcd.gcd(d, c)
    print(sum)

if __name__ == '__main__':
    quest_c()
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - 
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

if popular_num >= m:
  print('Yes')
else:
  print('No')

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))

MAX_VOTE_NUM = 1000

x = [-1] * MAX_VOTE_NUM
total_vote_num = 0
for i in range(n):
  x[a[i] - 1] = i
  total_vote_num += a[i]

popular_num = 0
for i in range(MAX_VOTE_NUM):
  index = MAX_VOTE_NUM - i
  if x[index - 1] != -1 and (index * 4 * m) >= total_vote_num:
    popular_num += 1

if popular_num >= m:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())

if n != k:
  x1 = n % k
  x2 = k - x1
  print(min(x1, x2))
else n == k:
  print(0)

Fixed submission:
n, k = map(int, input().split())

if n != k:
  x1 = n % k
  x2 = k - x1
  print(min(x1, x2))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
def f03():
    n=int(input())
    s, t=map(str, input().split())
    print(*[s[i]+t[i] for i in range(n)], seq='')
f03()

Fixed submission:
def f03():
    n=int(input())
    s, t=map(str, input().split())
    print(''.join([s[i]+t[i] for i in range(n)]))
f03()
Buggy python submission (verdict: Runtime Error):
def f06():
    n=int(input())
    s=input()
    k=int(input())
    x=s[k-1]
    for i in range(n):
        if s[i]!=x:
            s[i]='*'
    print(s)
f06()

Fixed submission:
def f06():
    n=int(input())
    S=input()
    k=int(input())
    for s in S:
        print(s if s==S[k-1] else '*', end='')
f06()

Buggy python submission (verdict: Runtime Error):
def f06():
    n=int(input())
    s=input()
    k=int(input())
    x=s[k-1]
    for i in range(n):
        if s[i]!=x:
            s[i]='*'
    print(''.join(s))
f06()


Fixed submission:
def f06():
    n=int(input())
    S=input()
    k=int(input())
    for s in S:
        print(s if s==S[k-1] else '*', end='')
f06()
Buggy python submission (verdict: Runtime Error):
def f10():
    N, M, X=map(int, input().split())
    A=[int(i)-1 for i in input().split()]
    X = X-1
    s=sum(A[i]<X for i in A)
    print(min(s, M-s))

def main():
    f10()

main()

Fixed submission:
def f10():
    N, M, X=map(int, input().split())
    A=[int(i)-1 for i in input().split()]
    X = X-1
    s=sum(A[i]<X for i in range(len(A)))
    print(min(s, M-s))

def main():
    f10()

main()
Buggy python submission (verdict: Runtime Error):
O=input()
E=input() + ''
print(''.join([O[i]+E[i] for i in range(len(O))]))

Fixed submission:
O=input()
E=input() + ' '
print(''.join([O[i]+E[i] for i in range(len(O))]))

Buggy python submission (verdict: Runtime Error):
def f07():
    O=input()
    E=input()
    print(''.join([O[i]+E[i] for i in range(len(O))]))
f07()

Fixed submission:
O=input()
E=input() + ' '
print(''.join([O[i]+E[i] for i in range(len(O))]))
Buggy python submission (verdict: Runtime Error):
a, b, c=map(int, input().split(','))
print(a, b, c)

Fixed submission:
a, b, c=map(str, input().split(','))
print(a, b, c)
Buggy python submission (verdict: Runtime Error):
s=input()
ptint('A'+s[8]+'C')

Fixed submission:
s=input()
print('A' + s[8] + 'C')

Buggy python submission (verdict: Runtime Error):
s=input()
print('A{}C'.format(s[8])

Fixed submission:
s=input()
print('A' + s[8] + 'C')

Buggy python submission (verdict: Runtime Error):
s = input()
print('A{}C'.format(s[8])

Fixed submission:
s=input()
print('A' + s[8] + 'C')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k, q = map(int, input().split())

score = np.full(n, k)

for _ in range(q):
    a = int(input())
    mask = np.ones(n, dtype=bool)
    mask[a-1] = False
    score[mask] = score[mask] - 1
    
for s in score:
    if s <= 0:
        print("No")
    else :
        print("Yes")

Fixed submission:
n, k, q = map(int, input().split())

score = [0] * n

for _ in range(q):
    a = int(input())
    score[a-1] +=1
    
s = sum(score)
for i in range(n):
    if k - (s-score[i]) <= 0:
        print("No")
    else :
        print("Yes")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
tower = [n*(2+(i-1))/2 for i in range(1, 1000)]

for i in range(999):
  if b - a == tower[i+1] - tower[i]:
    print(a-tower[i])
    break


Fixed submission:
a, b = map(int, input().split())
tower = [i*(2+(i-1))/2 for i in range(1, 1000)]

for i in range(999):
    if a - tower[i] == b - tower[i+1]:
        print(int(abs(tower[i]-a)))
        break