Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
a = []
for i in range(H):
    a.append(input())


for index, i in enumerate(a):
    if i == '.'*W:
        a.remove('.'*W)


aa = list(map(list, zip(*a)))


for index, i in enumerate(aa):
    if i == ['.']*len(aa[0]):
        aa.remove(tamesi)

aaa = list(map(list, zip(*aa)))

for i in aaa:
    print(''.join(i))

Fixed submission:
H, W = map(int, input().split())
a = []
ans = []
for i in range(H):
    a.append(input())
    
    if len(set(a[-1])) == 1 and a[-1][0] == '.':
        del a[-1]

if len(a) == 1:
    kotae = a[0]
    kotae = kotae.replace('.', '')
    print(kotae)
else:
    for x in range(W):
        check = []
        for y in range(len(a)):

            if a[y][x] != '.':
                break
            else:
                check.append(a[y][x])
                
        if len(check) == len(a):
            ans.append(x)
            
    
    if len(ans) >= 1:
        re_ans = []
        for i in a:
            kari = list(i)
            for j in ans:
                kari[j] = '0'
           # print(kari)
            re_ans.append(kari)
        
        for i in re_ans:
            moji = ''.join(i)
            mojji = moji.replace('0', '')
            print(mojji)
    else:
        for i in a:
            print(i)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+K-1])
    ans2 = abs(x[i+N-K])+abs(x[i]-x[i+K-1])
    ans = min(ans, ans1, ans2)
print(ans)

Fixed submission:
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+K-1])
    ans2 = abs(x[i+K-1])+abs(x[i]-x[i+K-1])
    ans = min(ans, ans1, ans2)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 10**9

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+N-K])
    ans2 = abs(x[i+N-K])+abs(x[i]-x[i+N-K])
    ans = min(ans, ans1, ans2)
print(ans)

Fixed submission:
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+K-1])
    ans2 = abs(x[i+K-1])+abs(x[i]-x[i+K-1])
    ans = min(ans, ans1, ans2)
print(ans)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+N-K])
    ans2 = abs(x[i+N-K])+abs(x[i]-x[i+N-K])
    ans = min(ans, ans1, ans2)
print(ans)

Fixed submission:
N, K = map(int, input().split())
x = list(map(int, input().split()))
ans = 3*10**8

for i in range(N-K+1):
    ans1 = abs(x[i])+abs(x[i]-x[i+K-1])
    ans2 = abs(x[i+K-1])+abs(x[i]-x[i+K-1])
    ans = min(ans, ans1, ans2)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
if N <=104:
    print(0)
    
elif N <= 106:
    print(1)

else:
    if N%2 != 0:
        num = list(range(105, N+1))
        kotae = list(range(1, N+2, 2))
    else:
        num = list(range(105, N))
        kotae = list(range(1, N, 2))
        
    num = num[::2]
    ans = [0] * len(num)
    
    for index, i in enumerate(num):
        for t in kotae:
            if i%t ==0:
                ans[index] += 1

print(len([1 for x in ans if x>=8]))


Fixed submission:
N = int(input())
if N <=104:
    print(0)
    
elif N <= 106:
    print(1)

else:
    if N%2 != 0:
        num = list(range(105, N+1))
        kotae = list(range(1, N+2, 2))
    else:
        num = list(range(105, N))
        kotae = list(range(1, N, 2))
        
    num = num[::2]
    ans = [0] * len(num)
    
    for index, i in enumerate(num):
        for t in kotae:
            if i%t ==0:
                ans[index] += 1
    print(len([1 for x in ans if x>=8]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
A = [A[_] - (_ + 1) for _ in range(N)]
AA = sorted(A)
ans = 0
ans1 = 0
if N % 2 != 0:
    center = N // 2
    num = AA[center]
    for i in range(N):
        ans += abs(AA[i]-num)
    print(ans)
else:
    center = len(AA) // 2
    for i in range(N):
        ans += abs(AA[i]- num)
        ans1 += abs(AA[i]-(num + 1))
    print(min(ans, ans1))

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
A = [A[_] - (_ + 1) for _ in range(N)]
AA = sorted(A)
ans = 0
ans1 = 0
center = N // 2
num = AA[center]

if N % 2 != 0:
    for i in range(N):
        ans += abs(AA[i] - num)
    print(ans)
else:
    center = len(AA) // 2
    for i in range(N):
        ans += abs(AA[i]- num)
        ans1 += abs(AA[i]-(AA[center-1]))
    print(min(ans, ans1))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
for i in range(n):
  a[i] -= (i+1)
ave = sum(a) // n
foi i in range(n):
  a[i] = abs(a[i] - ave)
print(sum(a))

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
A = [A[_] - (_ + 1) for _ in range(N)]
AA = sorted(A)
ans = 0
ans1 = 0
center = N // 2
num = AA[center]

if N % 2 != 0:
    for i in range(N):
        ans += abs(AA[i] - num)
    print(ans)
else:
    center = len(AA) // 2
    for i in range(N):
        ans += abs(AA[i]- num)
        ans1 += abs(AA[i]-(AA[center-1]))
    print(min(ans, ans1))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
min_in = A.index(1)

left = len(A[0:min_in])

right = len(A[min_in+1:])
#print(left,  right)
if N ==K:
    ans = 1
    
else:
    if (min(left, right) + 1) < K:
        ans += 1
        tuyoi = len(A-K)
        
        ans += tuyoi//K
        
        if tuyoi % K !=0:
            ans +=1
    
    else:
        if left != 0:
            ans += left//(K-1)
            
            if left%(K-1) != 0:
                ans += 1
        
        if right != 0:
            ans += right//(K-1)
            
            if right%(K-1) != 0:
                ans += 1
print(ans)

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

if (N-1)%(K-1) ==0:
    print((N-1)//(K-1))
else:
    print((N-1)//(K-1)+1)

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
min_in = A.index(1)

left = len(A[0:min_in])

right = len(A[min_in+1:])

if N ==K:
    ans = 0
    
else:
    if (min(left, right) + 1) < K:
        ans += 1
        tuyoi = len(A-K)
        
        ans += tuyoi//K
        
        if tuyoi % K !=0:
            ans +=1
    
    else:
        if left != 0:
            ans += left//(K-1)
            
            if left%(K-1) != 0:
                ans += 1
        
        if right != 0:
            ans += right//(K-1)
            
            if right%(K-1) != 0:
                ans += 1
print(ans)

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

if (N-1)%(K-1) ==0:
    print((N-1)//(K-1))
else:
    print((N-1)//(K-1)+1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
check = [0]*29
for i in range(1, 30):
    check[i-1] = 2**i

for i in A:
    if i % 2 == 0:
        j = 0
        while check[j] <= i:
            if i % check[j] == 0:
                add = check[j]
            else:
                break
                
            j += 1
        ans += j
        
print(ans)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
check = [0]*30
for i in range(1, 31):
    check[i-1] = 2**i

for i in A:
    if i % 2 == 0:
        j = 0
        while check[j] <= i:
            if i % check[j] == 0:
                add = check[j]
            else:
                break
                
            j += 1
        ans += j
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())

for n in range(1, 999):
    for x in range(1, 499500):
        if a == (1/2)*n*(n+1)-x and b == (1/2)*(n+1)*(n+2)-x:
            print(x)
            break

Fixed submission:
a, b = map(int, input().split())
print(int((0.5)*(b-a)*(b-a+1)-b))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
ans = 3 * 10**5
if S[0] =='W':
    left = 1
else:
    left = 0
for index, num in enumerate(S):
    ans = min(ans, S[index+1:].count('E')+S[:index].count('W'))

print(ans)

Fixed submission:
N = int(input())
S = input()
l = 0
r = S[1:].count('E')
ans = l+r

for i in range(1, N):
    if S[i-1] == 'W':
        l += 1
    
    if S[i] == 'E':
        r -= 1
    ans = min(ans, r+l)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
X = int(input())
ans = [1]
if X == 1 or X == 2:
	print(1)
else:
	for i in range(2, X + 1):
		num = i
		count = 1
		while num ** i <= X:
			count += 1
			ans.append(num ** i)
	print(max(ans))

Fixed submission:
x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)

Buggy python submission (verdict: Runtime Error):
X = int(input())
ans = [1]


if X == 1 or X == 2:
    print(1)
else:
	for i in range(2, X + 1):
    	num = i
    	count = 1
    	while num ** i <= X:
            count += 1
            ans.append(num ** i)
            
    print(max(ans))

Fixed submission:
x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)

Buggy python submission (verdict: Runtime Error):
X = int(input())
ans = [1]


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** i <= X:
            count += 1
            ans.append(num ** i)
	print(max(ans))

Fixed submission:
x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)

Buggy python submission (verdict: Runtime Error):
X = int(input())
ans = [1]


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** i <= X:
            count += 1
            ans.append(num ** i)
	print(max(ans))

Fixed submission:
x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)

Buggy python submission (verdict: Runtime Error):
X = int(input())
ans = set(1)


if X == 1 or X == 2:
    print(1)
else:
    for i in range(2, X + 1):
        num = i
        count = 1
        while num ** i <= X:
            count += 1
            ans.add(num ** i)
print(max(ans))

Fixed submission:
x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ans = 1000

if n == 1:
    print(n)
else:
    for b in range(2, 33):
        for p in range(2, 11):
            if n-b**p > 0:
                result = min(ans, b**p)

print(result)

Fixed submission:
x = int(input())
out = 1
for i in range(2,33):
    for j in range(2,10):
        num = i**j
        if x >= num:
            out = max(out, num)
print(out)
Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())
N = len(s)
ans = []

for i in range(1, min(N, 6)):
    for j in range(N - i + 1):
        ans.append(s[j:j+i])

ans = list(set(ans))
ans.sort()
print(ans[K-1])

Fixed submission:
s = input()
K = int(input())
one = list(set(s))
check = 2
if len(s) >= 2:
    while check <= len(s) and check <= 5:
        for i in range(len(s) - check + 1):
            one.append(s[i:i+check])
        check += 1
    one = sorted(set(one))
    print(one[K-1])
    
     
else:
    one = sorted(one)
    print(one[K-1])

Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())
ans = []
for i in set(s):
    ans.append(i)

if K == 1:
    print(sorted(ans)[0])
else:
    for i in range(2, 6):
        for j in range(len(s) - i + 1):
            ans.append(s[j:j+i])
    ans = set(ans)
    ans.sort()
    print(ans[K - 1])

Fixed submission:
s = input()
K = int(input())
one = list(set(s))
check = 2
if len(s) >= 2:
    while check <= len(s) and check <= 5:
        for i in range(len(s) - check + 1):
            one.append(s[i:i+check])
        check += 1
    one = sorted(set(one))
    print(one[K-1])
    
     
else:
    one = sorted(one)
    print(one[K-1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
X = [int(_) for _ in input().split()]

X2 = sorted(X)
r = X2[N // 2 ]
l = X2[N // 2 -1]

for i in range(N):
    if X2.index(X[i]) < N // 2:
        print(r)
    else:
        print(l)

Fixed submission:
import bisect

N = int(input())
X = [int(_) for _ in input().split()]

X2 = sorted(X)
r = X2[N // 2 ]
l = X2[N // 2 -1]

for i in range(N):
    if bisect.bisect_left(X2, X[i]) < N // 2:
        print(r)
    else:
        print(l)

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

N = int(input())
X = [int(_) for _ in input().split()]

X2 = sorted(X)
r = X2[N // 2 ]
l = X2[N // 2 -1]

for i in range(N):
    ind = bitsect.bitsect_left(X2, X[i])
    if idx < N // 2:
        print(r)
    else:
        print(l)

Fixed submission:
import bisect

N = int(input())
X = [int(_) for _ in input().split()]

X2 = sorted(X)
r = X2[N // 2 ]
l = X2[N // 2 -1]

for i in range(N):
    if bisect.bisect_left(X2, X[i]) < N // 2:
        print(r)
    else:
        print(l)
Buggy python submission (verdict: Runtime Error):
A, B, C = list(map(int, input().split()))
ABC = [A, B, C].sort()
A = ABC[0]
B = ABC[1]
C = ABC[2]

ans = 0

A = (C-A)//2
B =(C-B)//2

ans += (C-A)//2+(C-B)//2

if A == B == C:
    print(ans)
elif A ==C:
    print(ans+1)
else:
    print(ans+2)

Fixed submission:
A, B, C = list(map(int, input().split()))
ABC = [A, B, C]
ABC.sort()
A = ABC[0]
B = ABC[1]
C = ABC[2]
ans = 0

if (C-A) >= 2:
    ans += (C-A)//2
    A += 2*((C-A)//2)
if (C-B) >= 2:
    ans += (C-B)//2
    B += 2*((C-B)//2)
 
if A == B == C:
    print(ans)
elif A ==B:
    print(ans+1)
else:
    print(ans+2)
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
num = 0
if A <= B:
    if C <= D:
        print(A+C)
    else:
        print(A+D)
else:
    if C<= D:
        print(B+C)
    else:
        print(B+D)

Fixed submission:
A = [int(input()) for i in range(4)]
print(min(A[0], A[1])+min(A[2], A[3]))

Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
num = 0
if A <= B:
    if C <= D:
        print(B+D)
    else:
        print(B+C)
else:
    if C<= D:
        print(A+D)
    else:
        print(A+C)

Fixed submission:
A = [int(input()) for i in range(4)]
print(min(A[0], A[1])+min(A[2], A[3]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = [int(input()) for i in  range(N)]
M = int(input())
t = [int(input()) for i in  range(M)]
ans = 0
for word in set(s):
    ans = max(ans, s.count(word)-t.count(word))
print(ans)

Fixed submission:
N = int(input())
s = [(input()) for i in range(N)]
M = int(input())
t = [(input()) for i in range(M)]
ans = 0
for word in set(s):
    ans = max(ans, s.count(word)-t.count(word))

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())

R = [list(map(int, input().split())) for i in range(N)]
B = [list(map(int, input().split())) for i in range(N)]
R.sort(key = lambda x:x[1], reverse = True)
B.sort()
ans = 0
check = []


for bx, by in B:
    for i in range(N):
        if bx > R[i][0] and by > R[i][1] and i not in check :
            ans += 1
            check.append(i)
            break
            #print('B', bx, by, 'R',R[i][0], R[i][1] )
print(ans)

Fixed submission:
N = int(input())

R = [list(map(int, input().split())) for i in range(N)]
B = [list(map(int, input().split())) for i in range(N)]
R.sort(key = lambda x:x[1], reverse = True)
B.sort()
ans = 0
check = []


for bx, by in B:
    for i in range(N):
        if bx > R[i][0] and by > R[i][1] and i not in check :
            ans += 1
            check.append(i)
            break
            #print('B', bx, by, 'R',R[i][0], R[i][1] )
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = set(map(int, input().split()))
if len(S) == 3:
    print('Three')
else:
    print('Four')

Fixed submission:
N = int(input())
S = map(str, input().split())
if 'Y' in S:
    print('Four')
else:
    print('Three')
Buggy python submission (verdict: Runtime Error):
import math

a, b = map(int, input().split())
ab = int(str(a) + str(b))
for i in range(1, math.sqrt(ab) + 2):
    if i ** 2 == ab:
        print('Yes')
        break
else:
    print('No')

Fixed submission:
a, b = map(str, input().split())
c = int(a+b)
ans = 'No'
for i in range(4, 317):
    if i**2 == c:
        ans = 'Yes'
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
list_d=[input() for i in range(n)]
new_list_d = set(list_d)
sum1 = len(list(new_list_d))
print(sum1)

Fixed submission:
s = input()
print(s.replace('2017', '2018'))

Buggy python submission (verdict: Runtime Error):
n = int(input())
list_d = list(map(int, input().split()))
new_list_d = set(list_d)
sum1 = len(list(new_list_d))
print(sum1)

Fixed submission:
s = input()
print(s.replace('2017', '2018'))
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
Y = Y //1000
#x, y, z =1, 5, 10
for x in range(N+1):
    y = (10*N-9*x-Y)//5
    z = ((-5*N)+Y+4*x)//5
    
    if (-5*N+y+4*x) % 5 == 0 and  (10*N-9*x-Y) % 5 == 0 and y >= 0 and z >= 0 and x+y+z = Y:
        print(x, y, z)
        break
else:
    print(-1, -1, -1)

Fixed submission:
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print(i, j, n - i - j)
            exit()
print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
S = input()
if S[A] == '-' and A+B+1 == len(S):
    S = a[:A]+a[A+1:]
    try:
        S = int(S)
        print('Yes')
    except:
        print('No')
else:
    print('No')

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

if len(S) == A+B+1 and S[A] == '-' and S.count('-') == 1:
    print('Yes')

else:
    print('No')
Buggy python submission (verdict: Runtime Error):
s = sorted(input())
t = sorted(input(), reverse = True)
jud = False

if len(s) < len(t):
    for i in range(len(s)):
        if ord(s[i]) > ord(t[i]):
            break
    jud = True
else:
    for i in range(len(s)):
        count = 0
        if ord(s[i]) < ord(t[i]):
            count += 1
        elif ord(s[i]) > ord(t[i]):
            break
    if count >= 1:
        jud = True

print('Yes' if jud == True else 'No')
        

Fixed submission:
s = sorted(list(input()))
t = sorted(list(input()), reverse=True)

ss = ''.join(s)
tt = ''.join(t)

ans = sorted([tt,ss])

if ss == tt:
    print('No')
else:
    print(['No', 'Yes'][ans[0] == ss])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

ans = 0
flag = True

while flag:
    for i in A:
        if i % 2 == 0 and i != 0:
            i //= 2
        else:
            flag = False
    if flag == True:
        ans += 1
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
while 1 not in [a%2 for a in A]:
    A = [a//2 for a in A]
    ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

ans = 0
flag = True

while flag:
    for i in A:
        if i % 2 == 0 and i != 0:
            i %= 2
        else:
            flag = False
    if flag == True:
        ans += 1
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
while 1 not in [a%2 for a in A]:
    A = [a//2 for a in A]
    ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

ans = 0
flag = True

while flag:
    for i in A:
        if i % 2 == 0:
            i %= 2
        else:
            flag = False
    if flag == True:
        ans += 1
print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
while 1 not in [a%2 for a in A]:
    A = [a//2 for a in A]
    ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N , K = map(int, input().split())
A = list(map(int, input().split()))
syurui = set(A)
n_syurui =len(syurui)
ans = 0
if n_syurui > K:
    ans = sum(sorted([A.count(i) for i in syurui])[:n_syurui-K])
print(ans)

Fixed submission:
import collections
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
hint = collections.Counter(A)
ans = 0
bb = hint.most_common()
if K >= len(bb):
    print(ans)
else:
    for i in range(-1, -(len(bb)-K)-1, -1):
        ans += bb[i][1]
    print(ans)

Buggy python submission (verdict: Runtime Error):
N , K = map(int, input().split())
A = list(map(int, input().split()))
syurui = set(A)
ans = 0
if len(syurui) > K:
    ans = sum(sorted([A.count(i) for i in syurui])[:n_syurui-K])
print(ans)

Fixed submission:
import collections
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
hint = collections.Counter(A)
ans = 0
bb = hint.most_common()
if K >= len(bb):
    print(ans)
else:
    for i in range(-1, -(len(bb)-K)-1, -1):
        ans += bb[i][1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N , K = map(int, input().split())
A = list(map(int, input().split()))
syurui = set(A)
n_syurui =len(syurui)
ans = 0
goukei = sorted([A.count(i) for i in syurui])

if n_syurui > K:
    ans = sum(goukei[:n_syurui-K])
    print(ans)
else:
    print(ans)

Fixed submission:
import collections
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
hint = collections.Counter(A)
ans = 0
bb = hint.most_common()
if K >= len(bb):
    print(ans)
else:
    for i in range(-1, -(len(bb)-K)-1, -1):
        ans += bb[i][1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N , K = map(int, input().split())
A = list(map(int, input().split()))
syurui = set(A)
goukei = []
ans = 0
for i in syurui:
    goukei.append(A.count(i))

goukei.sort()

if len(syurui) <= K:
    print(ans)
else:
    ans = sum(goukei[0:len(syurui)-K])
    print(ans)

Fixed submission:
import collections
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
hint = collections.Counter(A)
ans = 0
bb = hint.most_common()
if K >= len(bb):
    print(ans)
else:
    for i in range(-1, -(len(bb)-K)-1, -1):
        ans += bb[i][1]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N , K = map(int, input().split())
A = sorted(map(int, input().split()))
syurui = set(A)
goukei = []
ans = 0
for i in syurui:
    goukei.append(A.count(i))

goukei.sort()

if len(syurui) <= K:
    print(ans)
else:
    for i in range(len(syurui)-K):
        ans += goukei[i]
    print(ans)

Fixed submission:
import collections
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
hint = collections.Counter(A)
ans = 0
bb = hint.most_common()
if K >= len(bb):
    print(ans)
else:
    for i in range(-1, -(len(bb)-K)-1, -1):
        ans += bb[i][1]
    print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n[1] == n[2] and n[0] == [1] or n[1] == n[2] and n[2] == n[3]:
    print('Yes')
else:
    print('No')

Fixed submission:
n = (input())
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = = [2, 1]
for i in range(87):
    L.append(L[i]+L[i+1])
print(L[N])

Fixed submission:
L = [2, 1]
N = int(input())
for i in range(N-1):
    last_L = L[i] + L[i+1]
    L.append(last_L)
print(L[-1])