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

Fixed submission:
import numpy as np

N, K = map(int, input().split())
H = list(int(x) for x in input().split())

dp = np.full(N, np.inf)
dp[0] = 0
H = np.array(H)

for i in range(1, N):
    j = max(0,i-K)
    dp[i] = min(dp[j:i] + np.abs(H[i] - H[j:i]))

print(int(dp[N-1]))

Buggy submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
H = list(int(x) for x in input().split())

dp = np.full(N, np.inf)
dp[0] = 0
H = np.array(H)

for i in range(1, N):
    dp[i] = min(dp[max(0,i-K):i] + abs(H[i] - H[max(0,i-K):i]))

print(int(dp[N-1]))
Problem p03240 (python)

Fixed submission:
# C - Pyramid

N = int(input())
XYH = [tuple(int(i) for i in input().split()) for _ in range(N)]

XYH.sort(key = lambda x: x[2], reverse=True)

for cx in range(101):
    for cy in range(101):
        (x, y, h) = XYH[0]
        tmp_H = h + abs(x - cx) + abs(y - cy)
        for (x, y, h) in XYH:
            if h != max(tmp_H - abs(x - cx) - abs(y - cy), 0):
                break
        else:
            ans = (cx, cy, tmp_H)
            break

print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
# C - Pyramid

N = int(input())
XYH = [tuple(int(i) for i in input().split()) for _ in range(N)]

for cx in range(101):
    for cy in range(101):
        pre_tmp_H = 0
        for (x, y, h) in XYH:
            tmp_H = h + abs(x - cx) + abs(y - cy)
            if pre_tmp_H != 0 and tmp_H != pre_tmp_H:
                break
            pre_tmp_H = tmp_H
        else:
            ans = (cx, cy, tmp_H)

print(' '.join(map(str, ans)))

Buggy submission (verdict: Runtime Error):
# C - Pyramid

N = int(input())
XYH = [tuple(int(x) for x in input().split()) for _ in range(N)]

for cx in range(101):
    for cy in range(101):
        pre_tmp_H = 0
        for (x, y, h) in XYH:
            tmp_H = h + abs(x - cx) + abs(y - cy)
            if pre_tmp_H != 0 and tmp_H != pre_tmp_H:
                break
            pre_tmp_H = tmp_H
        else:
            ans = (cx, cy, tmp_H)

print(' '.join(map(str, ans)))
Problem p03262 (python)

Fixed submission:
# C - Skip

def gcd(x, y):
    if x == 0:
        return y
    else:
        return gcd(y%x, x)

N, X = map(int, input().split())
x = list(int(x) for x in input().split())
x.append(X)
x.sort()
stnd = x[0]
for i in range(N+1):
    x[i] -= stnd

ans = gcd(x[0], x[1])
for i in range(1, N):
    ans = gcd(ans, gcd(x[i], x[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
# C - Skip

import numpy as np
import math

N, X = map(int, input().split())
x = list(int(x) for x in input().split())
x.append(X)
x.sort()
x = np.array(x)
x = x - x[0]

ans = 10**18
if N == 1:
    print(x[1] - x[0])
else:
    for i in range(N-1):
        ans = min(ans, math.gcd(x[i], x[i+1]))
    print(ans)
Problem p03330 (python)

Fixed submission:
# D - Good Grid

from collections import defaultdict
import itertools

N, C = map(int, input().split())
D = [[0] * C for _ in range(C)]
for i in range(C):
    D[i] = list(int(d) for d in input().split())

# MOD3の世界で0,1,2ごとに、最初の値の数をカウントしておく
dict_c = [defaultdict(int) for _ in range(3)]
for i in range(N):
    c = list(int(x) for x in input().split())
    for j in range(N):
        dict_c[(i+j)%3][c[j]-1] += 1

# ここからは全探索。
# 0, 1, 2の各配列に対して、全ての色を試す(C**3)
list_C = list(range(C))
ans = 10**18
for (p, q, r) in itertools.permutations(list_C, 3):
    tmp = 0
    for i, j in enumerate((p, q, r)):
        for m, n in dict_c[i].items():
            tmp += D[m][j] * n
    ans = min(ans, tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
# D - Good Grid

from collections import defaultdict
import itertools

N, C = map(int, input().split())
D = [[0] * C for _ in range(C)]
for i in range(C):
    D[i] = list(int(d) for d in input().split())

# MOD3の世界で0,1,2ごとに、最初の値の数をカウントしておく
dict_c = [defaultdict(int) for _ in range(3)]
for i in range(N):
    c = list(int(x) for x in input().split())
    for j in range(N):
        dict_c[(i+j)%3][c[j]-1] += 1

# ここからは全探索。
# 0, 1, 2の各配列に対して、全ての色を試す(C**3)
list_C = list(range(C))
ans = 10**18
for (p, q, r) in itertools.permutations(list_C):
    tmp = 0
    for i, j in enumerate((p, q, r)):
        for m, n in dict_c[i].items():
            tmp += D[m][j] * n
    ans = min(ans, tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
# D - Good Grid

from collections import defaultdict
import itertools

N, C = map(int, input().split())
D = [[0] * C for _ in range(C)]
for i in range(C):
    D[i] = list(int(d) for d in input().split())

# MOD3の世界で0,1,2ごとに、最初の値の数をカウントしておく
dict_c = [defaultdict(int) for _ in range(3)]
for i in range(N):
    c = list(int(x) for x in input().split())
    for j in range(N):
        dict_c[(i+j)%3][c[j]-1] += 1
#print(D)
#print(dict_c)

# ここからは全探索。
# 0, 1, 2の各配列に対して、全ての色を試す(C**3)
list_C = list(range(C))
ans = 10**18
for (p, q, r) in itertools.permutations(list_C):
    tmp = 0
    for i, j in enumerate((p, q, r)):
        #print(p, q, r)
        for i, k in dict_c[i].items():
            #print(i, j, k)
            #print(D[i][j])
            tmp += D[i][j] * k
    #print(tmp)
    ans = min(ans, tmp)

print(ans)
Problem p04013 (python)

Fixed submission:
import numpy as np

N, A = map(int,input().split())
X = [int(x) for x in input().split()]
 
dp = np.zeros((N+1,N*A+1),dtype=np.int64)
dp[0,0] = 1
 
for x in X:
    dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for n in range(1,N+1):
    ans += dp[n,n*A]

print(ans)

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

N, A = map(int,input().split())
X = [int(x) for x in input().split()]
 
dp = np.zeros((N+1,sum(X)+1),dtype=np.int64)
dp[0,0] = 1
 
for x in X:
    dp[1:,x:] += dp[:-1,:-x].copy()
  
ans = 0
for n in range(1,N+1):
    ans += dp[n,n*A]

print(ans)
Problem p04014 (python)

Fixed submission:
import math

n = int(input())
s = int(input())
ans = -1

def func(b, n):
    if n < b:
        return n
    else:
        return func(b, n//b) + n%b

if n < s:
    ans = -1
elif n == s:
    ans = n+1
else:
    for b in range(2,int(math.sqrt(n))+1):
      if func(b, n) == s:
          ans = b
          break

    if ans == -1:
        for p in range(1,int(math.sqrt(n))+1):
            b = int((n-s)/p+1)
            if b >= 2 and func(b, n) == s:
                ans = b
print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
s = int(input())
ans = -1

def func(b, n):
    if n < b:
        return n
    else:
        return func(b, n//b) + n%b

if n < s:
    ans = -1
elif n == s:
    ans = n+1
else:
    for b in range(2,int(math.sqrt(n))):
      if func(b, n) == s:
          ans = b
          break

    if ans == -1:
        for p in range(1,int(math.sqrt(n))):
            if func((n-s)/p+1, n) == s:
                ans = int((n-s)/p+1)
print(ans)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
s = int(input())
ans = -1

def func(b, n):
    if n < b:
        return n
    else:
        return func(b, n//b) + n%b

if n > s:
    ans = -1
elif n == s:
    ans = n+1
else:
    for b in range(2,int(math.sqrt(n))):
      if func(b, n) == s:
          ans = b
          break

    if ans == -1:
        for p in range(1,int(math.sqrt(n))):
            if func((n-s)/p+1, n) == s:
                ans = int((n-s)/p+1)
print(ans)
Problem p04044 (python)

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

for _ in range(n):
  s.append(input())
  
s.sort()
print(''.join(s))

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

for _ in range(n):
  s.append(input())

print(''.join(s.sort()))

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = list()
for _ in range(n):
  s.append(input())
  s.sort()
print('{}{}{}'.format(s[0],s[1],s[2]))
Problem p04046 (python)

Fixed submission:
def main():
    H, W, A, B = map(int, input().split())
    mod = 10**9 + 7
    ans = 0

    # 予め階乗を計算しておく
    f = [1]
    for i in range(H+W):
        f.append(f[i]*(i+1)%mod)

    # 組み合わせ関数
    def comb_mod(n, r, p):
        return f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p)

    for i in range(H-A):
        ans += comb_mod(i+B-1,B-1,mod) * comb_mod(H-1-i+W-B-1,W-B-1,mod)

    print(ans%mod)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    H, W, A, B = map(int, input().split())
    mod = 10**9 + 7
    ans = 0

    # 予め階乗を計算しておく
    f = [1]
    for i in range(H+W-B):
        f.append(f[i]*(i+1)%mod)

    # 組み合わせ関数
    def comb_mod(n, r, p):
        return f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p)

    for i in range(H-A):
        ans += comb_mod(i+B-1,B-1,mod) * comb_mod(H-1-i+W-B-1,W-B-1,mod)

    print(ans%mod)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    H, W, A, B = map(int, input().split())
    mod = 10**9 + 7
    ans = 0

    # 予め階乗を計算しておく
    f = [1]
    for i in range(H+W-B):
        f.append(f[i]*(i+1)%mod)

    # 組み合わせ関数
    def comb_mod(n, r, p):
        return f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p)

    for i in range(H-A):
        ans += (comb_mod(i+B-1,B-1,mod) * comb_mod(H-1-i+W-B-1,W-B-1,mod))%mod

    print(ans)

if __name__ == '__main__':
    main()
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
	b = X - a
    if 2 * a + 4 * b == Y:
		ans = 'Yes'
print(ans)
Problem p02621 (python)

Fixed submission:
a=int(input())

print(a+a*a+a*a*a)

Buggy submission (verdict: Runtime Error):
in1 = input().split(' ')
N=int(in1[0])
M=int(in1[1])
K=int(in1[2])

inA = input().split(' ')
inB = input().split(' ')

T = 0
Ac=0
Bc=0

while T < K:
  
  if Ac>=N and Bc>=M:
    break
  elif Ac>=N:
    Bn=int(inB[Bc])
    T+=Bn
    Bc+=1
  elif Bc>=M:
    An=int(inA[Ac])
    T+=An
    Ac+=1
  else:
    An=int(inA[Ac])
    Bn=int(inB[Bc])
    if An>Bn:
      T+=An
      Ac+=1
    else:
      T+=Bn
      Bc+=1
  
  

print(Ac+Bc)
Problem p02613 (python)

Fixed submission:
t = int(input())
wlist = [0]*4
for i in range(t):
    w = input()
    if w == "AC":
        wlist[0] += 1
    elif w == "WA":
        wlist[1] += 1
    elif w == "TLE":
        wlist[2] += 1
    else:
        wlist[3] += 1
print("AC x " + str(wlist[0]))
print("WA x " + str(wlist[1]))
print("TLE x " + str(wlist[2]))
print("RE x " + str(wlist[3]))

Buggy submission (verdict: Runtime Error):
t = int(input())
wlist = [0]*4
for i in range(t):
    w = input()
    if w == "AC":
        wlist[0] += 1
    elif w == "WA":
   	    wlist[1] += 1
    elif w == "TEL":
        wlist[2] += 1
    else:
        wlist[3] += 1
print("AC x " + wlist[0])
print("WA x " + wlist[1])
print("TEL x " + wlist[2])
print("RE x " + wlist[3])

Buggy submission (verdict: Runtime Error):
t = int(input())
wlist = [0]*4
for i in range(t):
  w = input()
  if w == "AC":
    wlist[0] += 1
  elif w = "WA":
   	wlist[1] += 1
  elif w = "TEL":
    wlist[2] += 1
  else:
    wlist[3] += 1
print("AC x " + wlist[0])
print("WA x " + wlist[1])
print("TEL x " + wlist[2])
print("RE x " + wlist[3])
Problem p02639 (python)

Fixed submission:
data = list(map(int, input().split()))
p = data.index(0)
print(p+1)

Buggy submission (verdict: Runtime Error):
data = list(map(int, input().split()))
p = data.find(0)
print(p+1)
Problem p02663 (python)

Fixed submission:
guh, gum, gbh, gbm, st = map(int, input().split())
if gbm < gum:
  gbh -= 1
  gbm += 60
tmp = (gbh-guh)*60+(gbm-gum)
ans = tmp-st
print(ans)

Buggy submission (verdict: Runtime Error):
guh, gum, gbh, bgm, st = map(int, input().split())
if bgm < gum:
  gbh -= 1
  bgm += 60
tmp = (gbh-guh)*60+(gbm-gum)
ans = tmp-st
print(ans)
Problem p02690 (python)

Fixed submission:
x = int(input())

b = -1
while True:
    b+=1
    amin = (x + b**5)**0.2
    apls = (x - b**5)**0.2

    if isinstance(amin, float):
        amin = round(amin,10)
        if amin.is_integer():
            print(int(amin),b)
            break
    
    if isinstance(apls,float):
        apls = round(apls,10)
        if apls.is_integer():
            print(int(apls),-1*b)
            break

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

b = -1
while True:
    b+=1
    amin = round((x + b**5)**0.2, 10)
    apls = round((x - b**5)**0.2,10)

    if isinstance(amin, float) and amin.is_integer():
        print(int(amin),b)
        break
    elif isinstance(apls,float) and apls.is_integer():
        print(int(apls),-1*b)
        break

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

b = -1
while True:
    b+=1
    amin = round((x + b**5)**0.2, 5)
    apls = round((x - b**5)**0.2,5)

    if isinstance(amin, float) and amin.is_integer():
        print(int(amin),1*b)
        break
    elif isinstance(apls,float) and apls.is_integer():
        print(int(apls),-1*b)
        break

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

a = 0
while True:
    bmin = (x + a**5)**0.2
    bpls = (x - a**5)**0.2

    if bmin.is_integer():
        print(a,int(bmin))
        break
    elif bpls.is_integer():
        print(a,int(bpls))
        break
    
    a+=1
    print(a)
Problem p02784 (python)

Fixed submission:
H, N = [int(x) for x in input().split()]
attacks = [int(x) for x in input().split()]
print("Yes" if H - sum(attacks) <= 0 else "No")

Buggy submission (verdict: Runtime Error):
H, N= map(int, input().split())
An = list(map(int, input().split()))
if sum(An)>= H:
	print('Yes')
else:
	print('No
Problem p02796 (python)

Fixed submission:
n=int(input())
l=[list(map(int,input().split())) for i in range(n)]
l.sort()
nl=[]
for i in range(n):
  nl.append([l[i][0]+l[i][1],l[i][0]-l[i][1]])
nl.sort()
if n==1:
  print(1)
else:
  ans=1
  k=nl[0][0]
  for i in range(1,n):
    if k<=nl[i][1]:
      ans+=1
      k=nl[i][0]
  print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
List = dict()
for i in range(N):
    X,L = map(int,input().split())
    List.update({X:L})
keys= sorted(List)
if len(List)<=1:
    print(len(List))
elif len(List)<3:
    if keys[0]+List[keys[0]]>keys[1]-List[keys[1]] or keys[1]-List[keys[1]]<keys[0]+List[keys[0]]:
        del List[keys[i]]
    print(len(List))
else:
    for i in range(1, len(keys)-1):
        if keys[i]+List[keys[i]]>keys[i+1]-List[keys[i+1]] or keys[i]-List[keys[i]]<keys[i-1]+List[keys[i-1]]:
            print(keys,keys[i],List[keys[i]],keys[i+1])
            del List[keys[i]]
    print(len(List))
Problem p02900 (python)

Fixed submission:
from fractions import gcd
def result(n):
    lists = list()
    num = n
    for i in range(2, int((n**0.5//1))+1):
        if num%i==0:
            time=0
            while num%i==0:
                num //= i
                time+=1
            if not i in lists:
                lists.append(i)
    if num!=1:
        if not num in lists:
                lists.append(num)
    return lists
A , B = list(map(int,input().split()))
print(len(result(gcd(A,B)))+1)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
def result(n):
    lists = list()
    num = n
    for i in range(2, int((n**0.5//1))+1):
        if num%i==0:
            time=0
            while num%i==0:
                num //= i
                time+=1
            if not i in lists:
                lists.append(i)
    if num!=1:
        if not num in arr:
                lists.append(num)
    return lists
A , B = list(map(int,input().split()))
print(len(result(gcd(A,B)))+1)

Buggy submission (verdict: Runtime Error):
import math
def result(n):
    lists = list()
    num = n
    for i in range(2, int((n**0.5//1))+1):
        if num%i==0:
            time=0
            while num%i==0:
                num //= i
                time+=1
            if not i in lists:
                lists.append(i)
    if num!=1:
        if not num in arr:
                lists.append(num)
    return lists
A , B = list(map(int,input().split()))
print(len(result(math.gcd(A,B)))+1)
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 1

for i in range(n):
  ans *= a[i]
  if ans > 10 ** 18:
    ans = -1
    break

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
	print(0)
	return
prod = 1
for a in A:
	prod *= a
	if prod > 1000000000000000000:
		print(-1)
		return
print(prod)

Buggy submission (verdict: Runtime Error):
def main ():
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
print(0)
return
prod = 1
for a in A:
prod *= a
if prod > 1000000000000000000:
print(-1)
return
print(prod)
main ()
Problem p03139 (python)

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

min = x + y - n
if min < 0 : min = 0

if x < y : print (str(x) + " " + str(min))
else : print(str(y) + " " + str(min))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = input()
b = input()
c = input()

t = n * 2;

for i in range(n):
    if a[i] == b[i] : t -= 1
    if b[i] == c[i] : t -= 1
    if c[i] == a[i] : t -= 1
    
    if a[i] == b[i] and b[i] == c[i] and c[i] == a[i] : t += 1
    
print(t)
Problem p03281 (python)

Fixed submission:
import numpy as np
n = int(input())
ans =0
for i in range(1,n+1):  
    if(i%2==0):
        continue
    count=0
    for j in range(1,i+1):
        if(i%j == 0):
            count += 1
    if(count == 8):
            ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
ans = 1
for i in range(1,n+1):  
    if(i%2==0):
        continue
    count=0
    for j in range(1,i+1):
        if(i%j == 0):
            count += 1
    if(count == 7):
            ans+=1
print(ans)

import numpy as np
n = int(input())
ans =0
for i in range(1,n+1):  
    if(i%2==0):
        continue
    count=0
    for j in range(1,i+1):
        if(i%j == 0):
            count += 1
    if(count == 7):
            ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
for i in range(n):  
    if(n%2==0):
        break
    count=0
    for j in range(2,int(np.sqrt(i))+1):
        if(i%j == 0):
            count += 1
        if(count == 7):
            break
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
count=0
for i in range(2,sprt(n)+1):
    if(n%i == 0):
        count += 1
    if(count == 7):
        break
print(count)
Problem p02576 (python)

Fixed submission:
N,X,T = map(int,input().split())
if N % X == 0:
  print(int(T*N/X))
else:
  print(T*(N//X+1))

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

count = 0
temp = a[0]

for i in range(n):
  if a[i] >= temp:
    temp = a[i]
  else:
    count += temp - a[i]
print(count)
Problem p02885 (python)

Fixed submission:
a,b=[int(a)for a in input().split()]

c=b+b
if(a-c!=0)and(a-c>=0):
    print(a-c)
else:
    print(0)

#print(type(c))

Buggy submission (verdict: Runtime Error):
a,b=input().split()
c=b+b
if(a-b!=0):
    print(int(a-b))
else:
    print(0)
Problem p02584 (python)

Fixed submission:
x, k, d = map(int,input().split())
x =abs(x)
s = x//d
if x-k*d>0:
  print(x-k*d)
else:
    if (k-s)%2==0:
        print(x-s*d)
    else:
        print(-x+(s+1)*d)

Buggy submission (verdict: Runtime Error):
x, k, d = map(int,input().split())
x =abs(x)
s = x//d
if x-k*d>0:
  print(x-k*d>0)
else:
    if (K-s)%2==0:
        print(X-s*D)
    else:
        print(-X+(s+1)*D)
Problem p02681 (python)

Fixed submission:
s= input()
t=input()

if t[:-1]==s:
  print('Yes')
else:
  print('No')

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

if a+b>=k:
  print(min(a,k))
else:
  print(2*a+b-k)
Problem p02755 (python)

Fixed submission:
a, b = map(int,input().split())
ans = -1
for i in range(10):
    num = 10*b + i
    if a <= num*0.08 < a+1:
        ans = num
        break
print(ans)

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

a1 =a//0.08
a2 =(a+1)//0.08
b1 = b//0.1
b2= (b+1)//0.1

A=range(a1,a2+1)
B=range(b1,b2+1)

if set(A)&set(B)==set():
  print(-1)
else:
  C = set(A)&set(B)
  print(min(C))
Problem p02783 (python)

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

ans = 0

while H>0:
	ans += 1
	H -= A

print(ans)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
H = sorted(list(map(int, input().split())))
print(sum([0] + H[:-K]) if K > 0 else sum(H))

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

H.sort(reverse=True)
del H[:K]
H_sum = sum(H)
print(H_sum)

Buggy submission (verdict: Runtime Error):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
if N<=K:
    print(0)
else:
    print(sum(H[0:N-K]))

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

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

Fixed submission:
a,b = map(int, input().split())
     
if a==b:
   print('Yes')
else:
   print('No')

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

if a=b:
   print('Yes')
else:
  print('No')
Problem p02817 (python)

Fixed submission:
S,T=input().split()
print(T+S)

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

print(t+s)
Problem p02911 (python)

Fixed submission:
n,k,q = map(int,input().split())
l= [int(input()) for i in range(q)]
x=[k-q]*n
for i in range(q):
  x[l[i]-1]+=1
for i in range(n):
  if x[i]>0: 
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,k,q = map(int,input().split())
l= [int(input()) for i in range(q)]
x=[k-q]*n
for i in range(q):
  x[l[i-1]]+=1
for i in range(n):
  if x[i]>0: 
    print("Yes")
  else:
    print("No")
Problem p02957 (python)

Fixed submission:
a, b = map(int, input().split())
     
if (a + b) / 2 == (a + b) // 2:
	print(int((a + b) / 2))
else:
	print('IMPOSSIBLE')

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

print((a+b)//2 if (a+b)% == 0 else 'IMPOSSIBLE')
Problem p02982 (python)

Fixed submission:
import math
     
n, D = map(int, input().split())
     
point = []
for _ in range(n):
	x = list(map(int, input().split()))
	point.append(x)
     
cnt = 0
for i in range(n-1):
	for j in range(i+1, n):
		dist = 0
		for d in range(D):
			dist += (point[i][d] - point[j][d])**2
     
		dist = math.sqrt(dist)
		if int(dist) == dist:
			cnt += 1
     
print(cnt)

Buggy submission (verdict: Runtime Error):
import math
     
n, D = map(int, input().split())
point = []
for _ in range(n):
	x = list(map(int, input().split()))
    point.append(x)
     
cnt = 0
for i in range(n-1):
	for j in range(i+1, n):
		dist = 0
        for d in range(D):
        	dist += (point[i][d] - point[j][d])**2
     
        dist = math.sqrt(dist)
        if int(dist) == dist:
        	cnt += 1
     
print(cnt)
Problem p02994 (python)

Fixed submission:
N, L = map(int,input().split())

total = N*(2*L+N-1)//2

if L>=0:
	small = L
elif L<0 and L+N-1>=0:
	small = 0
else:
	small = L+N-1
print(total - small)

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

ans == 0
for i in range(1,n+1):
  p = list[L+i-1]
  ans += p[i]

print(ans)
Problem p03102 (python)

Fixed submission:
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
ans=0
for _ in range(n):
	a=list(map(int,input().split()))
	if sum(a[i]*b[i] for i in range(m))+c>0: ans+=1
print(ans)

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

for i in range(n):
	a = list(map(int,input().split()))
    
x=0

for i in range(n):
	if ((sum(a[i]*b[i] for j in range(m)) + c)>0):
		x+=1
print(x)