Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
w ,k = map(int, input().split())
x = w - (k*2)
if 0 <= x:
  print(x)
 else:
  print(0)

Fixed submission:
w, k = map(int, input().split())
x = w - (k*2)
if 0 <= x:
    print(x)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=sorted([int(i) for i in input().split()],reverse=True)

ans=0
for i in range(n-2):
    c=l[i]
    x=0
    for j in range(i+1,n-1):
        b=l[j]
        for k in range(j+1,n):
            a=l[k]
            if c<(a+b):
                ans+=1
            else:
                if k==j+1:
                    x=1
                break
        if x==1:
            break

print(ans)

Fixed submission:
from bisect import bisect_left

N = int(input())
L = list(map(int, input().split()))

L.sort()
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        ans += bisect_left(L, L[i] + L[j]) - j - 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=sorted([int(i) for i in input().split()],reverse=True)

ans=0
for i in range(n-2):
    c=l[i]
    x=0
    for j in range(i+1,n-1):
        b=l[j]
        for k in range(j+1,n):
            a=l[k]
            if c<(a+b):
                co+=1
            else:
                if k==j+1:
                    x=1
                break
        if x==1:
            break

print(ans)

Fixed submission:
from bisect import bisect_left

N = int(input())
L = list(map(int, input().split()))

L.sort()
ans = 0
for i in range(N - 2):
    for j in range(i + 1, N - 1):
        ans += bisect_left(L, L[i] + L[j]) - j - 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())

ans = 2019

for i in range(l,r):
  for j in range(i + 1 ,r + 1):
      ans  = min(ans, (i * j) % 2019)
print(ans)

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

ans = 2019
#差が2018より大きいものは商が必ず1以上になるので、計算の量を減らす
if r - l >= 2018:
  print(0)
else:
  #for文でその他全て計算する
  for i in range(l,r):
    for j in range(i + 1 ,r + 1):
      #余りの最小値を求める
      ans  = min(ans, (i * j) % 2019)
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,d = map(int,input().split())
b = b + 1
count = 0
for i in range(a,b):
  if i % c != 0 and i % d != 0:
    count+=1
print(count)

Fixed submission:
#gcd関数(最大公約数を求める)
from fractions import gcd
a,b,c,d = map(int,input().split())
 
#c,dにおける最小公倍数を求める
z = c*d // gcd(c,d)
#a - 1以下の個数を求める
i = a - 1

#xはb以下で割り切れない個数を求める
x = b - (b // c + b // d - b // z)
#yはa - 1以下で割り切れない個数を求める
y = i - (i // c + i // d - i // z)
#b以下で割り切れない個数からa- 1以下で割り切れない個数引いた個数
print(x - y)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    s, p = input().split()
# pを数値に
    p = int(p)
# i,s,pの並びで入れる
    a.append([i+1, s, p])

# 点数の高い順に並べる
a.sort(key=lambda x:x[2], reverse=True)
# レストラン名の辞書順に並べる
a.sort(key=lambda x:x[1])
# それぞれの市について、辞書順に点数の高い順に並べる
for i in range(n):
    print(book[i][0])

Fixed submission:
n = int(input())
a = []
for i in range(n):
    s, p = input().split()
# pを数値に
    p = int(p)
# i,s,pの並びでlistを入れる
    a.append([i+1, s, p])

# 点数の高い順に並べる
a.sort(key=lambda x:x[2], reverse=True)
# レストラン名の辞書順に並べる
a.sort(key=lambda x:x[1])
# それぞれの市について、辞書順に点数の高い順に並べる
for i in range(n):
    print(a[i][0])
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = 0

for l in range(k + 1):
	for r in range(k - l + 1):
		hand = []
        if l + r > n:
          break
		#handに左からl個
		hand = v[: l]
        #右からr個の要素を追加
		hand.extend(v[n - r:])
        #現時点でのhandの和をhand_sum
		hand_sum = sum(hand)  
		hand.sort()
        #hand_sum中の負の要素を詰めていく
		for i in range(min(k - l - r, l + r)):
			if hand[i] < 0:
			  hand_sum -= hand[i]
		ans = max(ans, hand_sum)

print(ans)

Fixed submission:
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = 0

for l in range(k + 1):
	for r in range(k - l + 1):
		hand = []
		if l + r > n:
			break
        #handに左からl個
		hand = v[: l]
        #右からr個の要素を追加
		hand.extend(v[n - r:])
        #現時点でのhandの和をhand_sum
		hand_sum = sum(hand)  
		hand.sort()
        #hand_sum中の負の要素を詰めていく
		for i in range(min(k - l - r, l + r)):
			if hand[i] < 0:
			  hand_sum -= hand[i]
		ans = max(ans, hand_sum)

print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = 0

for l in range(k + 1):
	for r in range(k - l + 1):
		hand = []
		#handに左からl個
		hand = v[: l]
        #右からr個の要素を追加
		hand.extend(v[n - r:])
        #現時点でのhandの和をhand_sum
		hand_sum = sum(hand)  
		hand.sort()
        #hand_sum中の負の要素を詰めていく
		for i in range(min(k-l-r,l + r)):
			if hand[i] < 0:
			  hand_sum -= hand[i]
		ans = max(ans, hand_sum)

print(ans)

Fixed submission:
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = 0

for l in range(k + 1):
	for r in range(k - l + 1):
		hand = []
		if l + r > n:
			break
        #handに左からl個
		hand = v[: l]
        #右からr個の要素を追加
		hand.extend(v[n - r:])
        #現時点でのhandの和をhand_sum
		hand_sum = sum(hand)  
		hand.sort()
        #hand_sum中の負の要素を詰めていく
		for i in range(min(k - l - r, l + r)):
			if hand[i] < 0:
			  hand_sum -= hand[i]
		ans = max(ans, hand_sum)

print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = 0

for l in range(k + 1):
	for r in range(k - l + 1):
		hand = []
		#handに左からl個
		hand = v[: l]
        #右からr個の要素を追加
		hand.extend(v[n - r:])
        #現時点でのhandの和をhand_sum
		hand_sum = sum(hand)  
		hand.sort()
        #hand_sum中の負の要素を詰めていく
		for i in range(min(hand.sort())):
			if hand[i] < 0:
			  hand_sum -= hand[i]
		ans = max(ans, hand_sum)

print(ans)

Fixed submission:
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = 0

for l in range(k + 1):
	for r in range(k - l + 1):
		hand = []
		if l + r > n:
			break
        #handに左からl個
		hand = v[: l]
        #右からr個の要素を追加
		hand.extend(v[n - r:])
        #現時点でのhandの和をhand_sum
		hand_sum = sum(hand)  
		hand.sort()
        #hand_sum中の負の要素を詰めていく
		for i in range(min(k - l - r, l + r)):
			if hand[i] < 0:
			  hand_sum -= hand[i]
		ans = max(ans, hand_sum)

print(ans)
Buggy python submission (verdict: Runtime Error):
x + 1 = rx - d

r,d,x = map(int(),input().split())

for i in range(10):
 z = (r * x) - d
 print(z)
 x = z

Fixed submission:
r,d,x = map(int,input().split())

for i in range(10):
 z = (r * x) - d
 x = z
 print(z)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
count = 0

if a > b:
  count = a
  a = a - 1
  if a > b or a == b:
    count = count + a
elif b > a:
  count = b
  b = b - 1
  if b > a or a == b:
    count = count + b
else:
  count = a
  count = count + b

print(count)

Fixed submission:
a , b = map(int,input().split())
count = 0

if a > b:
  count = a
  a = a - 1
  if a > b or a == b:
    count = count + a
elif b > a:
  count = b
  b = b - 1
  if b > a or a == b:
    count = count + b
else:
  count = a
  count = count + b

print(count)
Buggy python submission (verdict: Runtime Error):
a =input()
b =input()
c =input()
d =input()
e =input()
k =input()

if b-a and c-b and d-c and e-d <= k:
   print("Yay!")
else:
   print(":(")

Fixed submission:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
k =int(input())

if e-a <= k:
   print("Yay!")
else:
   print(":(")
Buggy python submission (verdict: Runtime Error):
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())

sample_list = list(a,b,c,d,e)
z= sum(sample_list)
for f in sample_list:
    g = list(10 - (a % 10))

h = max(g)
i = sum(g) - h

print(z-i)

Fixed submission:
a =int(input())
b =int(input())
c =int(input())
d =int(input())
e =int(input())
sample_list = []
sample_list.append(a)
sample_list.append(b)
sample_list.append(c)
sample_list.append(d)
sample_list.append(e)
x = []
for i in sample_list:
    if i % 10 == 0:
        x.append(0)
    else:
        x.append(10-(i%10))
print(sum(sample_list)+sum(x)-max(x))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
INPUT = sys.stdin.readline
S = list(input())
S.reverse()
L = len(S)
A, B, C = 'A', 'B', 'C'

followingAs = 0
searchABC = 0
ans = 0

while S:

    last = S.pop()

    if last == A:
        if searchABC == 0:
            searchABC = 1
            followingAs += 1
            continue
        
        elif searchABC == 1:
            followingAs += 1
            continue
        
        else: #searchABC == 2:
            searchABC = 1
            followingAs = 1
            continue
    
    elif last == B:
        if searchABC == 0:
            continue

        elif searchABC == 1:
            searchABC += 1
            continue

        else: # searchABC == 2:
            searchABC = 0
            followingAs = 0
            continue

    else: # last == C

        if searchABC == 0:
            continue

        elif searchABC == 1:
            followingAs = 0
            searchABC = 0
            continue

        else:
            ans += followingAs
            S += ['A' for _ in range(followingAs)]
            followingAs = 0
            searchABC = 0
            continue

print(ans)

Fixed submission:
import sys
INPUT = sys.stdin.readline
S = list(input())
S.reverse()
L = len(S)
A, B, C = 'A', 'B', 'C'

followingAs = 0
searchABC = 0
ans = 0

while S:

    last = S.pop()

    if last == A:
        if searchABC == 0:
            searchABC = 1
            followingAs += 1
            continue
        
        elif searchABC == 1:
            followingAs += 1
            continue
        
        else: #searchABC == 2:
            searchABC = 1
            followingAs = 1
            continue
    
    elif last == B:
        if searchABC == 0:
            continue

        elif searchABC == 1:
            searchABC += 1
            continue

        else: # searchABC == 2:
            searchABC = 0
            followingAs = 0
            continue

    else: # last == C

        if searchABC == 0:
            continue

        elif searchABC == 1:
            followingAs = 0
            searchABC = 0
            continue

        else:
            ans += followingAs
            searchABC = 1
            continue

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A, B, AB = 'A', 'B', 'AB'
endA, startB = 0, 0
ans = 0

for _ in range(N):
    S = input()

    if S[0] == B:
        startB += 1

        if S[-1] == A:
            endA += 1
            startB_endA += 1

    elif S[-1] == A:
        endA += 1
    

    for i in range(1,len(S)):
        if S[i-1] + S[i] == AB:
            ans += 1

ans += min(endA, startB)

print(ans)

Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
A, B, AB = 'A', 'B', 'AB'
endA, startB, startB_endA = 0, 0, 0
ans = 0

for _ in range(N):
    S = input().rstrip()

    if S[0] == B:
        startB += 1

        if S[-1] == A:
            startB -= 1
            startB_endA += 1

    elif S[-1] == A:
        endA += 1
    

    for i in range(1,len(S)):
        if S[i-1] + S[i] == AB:
            ans += 1


if startB_endA == 0:
    ans += min(endA, startB)

elif endA == 0 and startB == 0:
    ans += max(0, startB_endA - 1)

else:
    ans += startB_endA + min(endA, startB)

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

todo = [[], []]

input = sys.stdin.readline
H, W = map(int, input().split())
field = np.zeros((H,W), dtype=int)

for i in range(H):
    for j, c in enumerate(input()):
        if c == '#':
            field[(i,j)] = 1
            todo[0].append((i,j))

def findAdjacent(loc):
    x, y = loc[0], loc[1]
    for dx, dy in [(-1,0), (1,0), (0,-1), (0,1)]:
        if -1 < x+dx < W and -1 < y+dy < H:
            yield (x+dx, y+dy)

def colorAdjacent(loc, nxt):
    for l in findAdjacent(loc):
        if field[l] == 0:
            todo[nxt].append(l)
            field[l] += 1

ans = 0
while todo[0] or todo[1]:
    cur = ans % 2
    while todo[cur]:
        colorAdjacent(todo[cur].pop(), (cur+1)%2)
    ans += 1

print(ans-1)


Fixed submission:
import sys
import numpy as np

#%% Smart Solution

input = sys.stdin.readline

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

status = np.full((H, W), H*W, dtype=int)
for i in range(H):
    for j, c in enumerate(input()):
        if c == "#":
            status[i,j] = 0


for h in range(1, H):
    status[h, :] = np.minimum(status[h, :], status[h-1, :] + 1)
for h in range(0, H-1)[::-1]:
    status[h, :] = np.minimum(status[h, :], status[h+1, :] + 1)
for w in range(1, W):
    status[:, w] = np.minimum(status[:, w], status[:, w-1] + 1)
for w in range(0, W-1)[::-1]:
    status[:, w] = np.minimum(status[:, w], status[:, w+1] + 1)

print(np.max(status))
Buggy python submission (verdict: Runtime Error):
import numpy as np
import itertools

N = int(input())

V = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))

ans = -1

for condition in itertools.product(range(2),repeat=N):

    cond_nparr = np.array(condition)

    x = np.sum(V[cond_nparr]) - np.sum(C[cond_nparr])

    ans = max(ans, x)

print(ans)


Fixed submission:
N = int(input())

V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0


for v, c in zip(V, C):

    if v > c:

        ans += (v-c)

print(ans)
Buggy python submission (verdict: Runtime Error):
N, Q = map(int, input().split())
S = input()
L = len(S)
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(L-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)


for _ in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1

    ans = 0
    for i in found_id:

        if l <= i and i+shiftID <= r:
            ans += 1
        elif r < i + shiftID:
            break

    print(ans)


Fixed submission:
d = {'A':'T', 'T':'A', 'G':'C', 'C':'G'}

print(d[input()])
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
L = len(S)
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(L-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)


for _ in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1

    ans = 0
    for i in found_id:

        if l <= i and i+shiftID <= r:
            ans += 1
        elif r < i + shiftID:
            break

    print(ans)


Fixed submission:
N, Q = map(int, input().split())
S = input()
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(N-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)

found_count = [0 for _ in range(N+1)]

for i in range(shiftID+1, N+1):
    found_count[i] = found_count[i-1] + (1 if S[i-shiftID-1:i]=='AC' else 0)

for _ in range(Q):
    l, r = map(int, input().split())
    print(found_count[r] - found_count[l])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())
S = input()
L = len(S)
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(L-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)


for _ in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1

    ans = 0
    for i in found_id:

        if l <= i and i+shiftID <= r:
            ans += 1
        elif r < i + shiftID:
            break

    print(ans)


Fixed submission:
N, Q = map(int, input().split())
S = input()
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(N-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)

found_count = [0 for _ in range(N+1)]

for i in range(shiftID+1, N+1):
    found_count[i] = found_count[i-1] + (1 if S[i-shiftID-1:i]=='AC' else 0)

for _ in range(Q):
    l, r = map(int, input().split())
    print(found_count[r] - found_count[l])
Buggy python submission (verdict: Runtime Error):
num_shops, target_drinks = map(int, input().split())
sell = {}

for _ in range(num_shops):
    a,b = map(int, input().split())

    try:
        sell[a] += b
    except:
        sell[a] = b

ans, bought = 0, 0

for price in sorted(sell):

    selling = sell[price]

    if bought + selling < target_drinks:
        ans += price * selling    
        bought += selling
    else:
        ans += price * (target_drinks - bought)
        break

print(ans)


Fixed submission:
H, W = map(int, input().split())

h, w = map(int, input().split())

tot = H * W

rows = h * W
cols = H * w
common = h * w

print(tot - rows - cols + common)
Buggy python submission (verdict: Runtime Error):
#%%
import math
A, B = map(int, input().split())
digits = int(math.log2(B)) + 1
#%%

def counter(start, end, x):
    place = 2 ** x
    if place == 1:
        return (start - end + 1) % 2

    start_group = start // place
    end_group = end // place

    start_effective, end_effective = 0,0

    if start_group % 2 == 1:
        start_effective = ( place - start % place ) % 2
    if start_group != end_group and end_group % 2 == 1:
        end_effective = ( place - end % place +1 ) % 2

    return place * ((start_effective + end_effective) % 2)

#%%
for x in range(int(math.log2(456))+1):
    print(counter(123,456,x))

#%%
if A != B:
    ans = 0
    for x in range(digits):
        ans += counter(A,B,x)

    print(ans)

else:
    print(A)

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

#%%
# a finction to find F(0,x)
def XOR_0_to_x(x):

    # for all even integer n, n ^ (n+1) = 1
    xor = ((x+1) // 2) % 2

    if x % 2 == 0:
        return xor ^ x

    else:
        return xor

#%%
# F(A,B) = F(0,A-1) ^ F(0,B)
ans = XOR_0_to_x(A-1) ^ XOR_0_to_x(B)

print(ans)
Buggy python submission (verdict: Runtime Error):
#%%
import sys
INPUT = sys.stdin.readline

def SINGLE_INT(): return int(INPUT())
def MULTIPLE_INT_LIST(): return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP(): return map(int, INPUT().split())
def SINGLE_STRING(): return INPUT()
def MULTIPLE_STRING(): return INPUT().split()

#%%

N, A, B, C = MULTIPLE_INT_MAP()
materials = MULTIPLE_INT_LIST()
INF = 10 ** 9

#%%

def dfs(cursor, a, b, c):  # cursor:カーソル a,b,c:現在の竹の長さ
    if cursor == N:  # cursorが最後まで行ったら終了する。
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) != 0 else INF
    # なぜ30を減じているのかというと、
    # dfs(0,0,0,0)で始まる以上、最初に選ばれるa,b,cを決定する際にもコストが10増加してしまうからである。

    # a,b,cのいずれかに1本も竹を利用していない場合は不適であるため、三項演算子を利用してその場合のコストをINFとする。

    # 再帰(4**N)
    # カーソルの当たっている竹に対して、(A or B or Cに合成する) or (合成しない)の場合に分ける
    no_compound = dfs(cursor+1, a, b, c)
    compound_to_a = dfs(cursor+1, a + materials[cursor], b, c) + 10
    compound_to_b = dfs(cursor+1, a, b + materials[cursor], c) + 10
    compound_to_c = dfs(cursor+1, a, b, c + materials[cursor]) + 10

    return min(no_compound, compound_to_a, compound_to_b, compound_to_c)

print(dfs(0, 0, 0, 0))

Fixed submission:
#%%
import itertools

#%%

N, A, B, C = map(int, input().split())
materials = [int(input()) for _ in range(N)]



iterobj = itertools.product(range(4),repeat=N)

ans = 10**8

for use in iterobj:

    if 1 in use and 2 in use and 3 in use:

        synth = [0,0,0,0]

        for m, u in  zip(materials, use):
            synth[u] += m

        mp = 10 * (use.count(1) + use.count(2) + use.count(3) - 3)

        mp += abs(A-synth[1]) + abs(B-synth[2]) + abs(C-synth[3])

        ans = min(ans, mp)

print(ans)
Buggy python submission (verdict: Runtime Error):

import sys
INPUT = sys.stdin.readline

def SINGLE_INT(): return int(INPUT())
def MULTIPLE_INT_LIST(): return list(map(int, INPUT().split()))
def MULTIPLE_INT_MAP(): return map(int, INPUT().split())
def SINGLE_STRING(): return INPUT()
def MULTIPLE_STRING(): return INPUT().split()

N, K = MULTIPLE_INT_MAP()
trees = [int(input()) for _ in range(N)]
trees.sort()
ans = float('inf')

# for i in range(0, N-K+1):
#     ans = min(ans, trees[i+K-1] - trees[i])
#     if ans == 0:
#         break

# print(ans)

print(min(trees[i+K-1]-trees[i] for i in range(N-K+1)))

Fixed submission:
D = int(input())

s = 'Christmas'

for _ in range(25-D):
    s += ' Eve'

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

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

trees = []

for _ in range(N):
    item = int(input())
    trees.insert(bisect.bisect_left(trees, item), item)    

curmin = 1 + 10**9

for i in range(N-K+1):
    curmin = min(curmin, trees[i+K-1] - trees[i])

print(curmin)

Fixed submission:
import heapq
import queue

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

trees = []
heapq.heapify(trees)

for _ in range(N):
    heapq.heappush(trees, int(input()))

ans = 1 + 10**9

q = queue.Queue(maxsize=K-1)

for _ in range(K-1):
    q.put(heapq.heappop(trees))

for _ in range(N-K+1):
    curmin = q.get()
    nextmin = heapq.heappop(trees)

    ans = min(ans, nextmin-curmin)

    q.put(nextmin)

print(ans)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())

#%%

n = 0
for fiveHundred in a:
    for hundred in b:
        for fifty in c:
            if x == 500*fiveHundred + 100*hundred + 50*fifty:
                n +=1

print(n)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
x = int(input())

n = 0
for fiveHundred in range(a+1):
    for hundred in range(b+1):
        for fifty in range(c+1):
            if x == 500*fiveHundred + 100*hundred + 50*fifty:
                n +=1

print(n)
Buggy python submission (verdict: Runtime Error):
n = input()
a = np.array(list(map(int, input().split())))

print(len(np.unique(a)))

Fixed submission:
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))

Buggy python submission (verdict: Runtime Error):
import numpy as np

a = list(map(int, input().split()))
arr = np.array(a[1:])

print(len(np.unuque(arr)))

Fixed submission:
n = int(input())
print(len(set(map(int, [input() for i in range(n)]))))
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())

cursum = 0

for n in range(1, l[0]+1):
    x = sum(map(int, str(n)))
    if a <= x and x <= b:
        cursum += n

print(cursum)

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

cursum = 0

for x in range(1, n+1):
    y = sum(map(int, str(x)))
    if a <= y and y <= b:
        cursum += x

print(cursum)

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

cursum = 0

for n in range(1, l[0]+1):
    x = sum(map(int, str(n)))
    if a <= x and x <= b:
        cursum += n

print(cursum)

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

cursum = 0

for x in range(1, n+1):
    y = sum(map(int, str(x)))
    if a <= y and y <= b:
        cursum += x

print(cursum)
Buggy python submission (verdict: Time Limit Exceeded):
n,k,q = map(int,input().split(" "))
point = [k for i in range(n)]

for i in range(q):
    ans = int(input())
    point=list(map(lambda x:x-1,point))
    point[ans-1] += 1

for i in range(n):
    if(point[i] <= 0):
        print("No")
    else:
        print("Yes")

Fixed submission:
n,k,q = map(int,input().split(" "))
point = [k-q for i in range(n)]

for i in range(q):
    ans = int(input())
    point[ans-1] += 1

for i in range(n):
    if(point[i] <= 0):
        print("No")
    else:
        print("Yes")