Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
li.sort
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.appemd(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))

Fixed submission:
n=int(input())
li=list(map(int,input().split()))
li.sort()
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.append(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))

Buggy python submission (verdict: Runtime Error):
n=int(input())
li=list(map(int,input().split()))
li.sort
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.appemd(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))

Fixed submission:
n=int(input())
li=list(map(int,input().split()))
li.sort()
a=[]
b=[]
for i in range(n):
  if n%2==1:
    if i%2==0:
      a.append(li[i])
    else:
      b.append(li[i])
  else:
    if i%2==0:
      b.append(li[i])
    else:
      a.append(li[i])
print(sum(a)-sum(b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=0
if n=1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
print(ans)    
      


Fixed submission:
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=1
if n==1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
  print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=0
if n=1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
    
      

Fixed submission:
n=int(input())
li=[input() for i in range(n)]
li.sort()
ans=1
if n==1:
  print(1)
else:
  for i in range(n-1):
    if li[i+1] > li[i]:
      ans+=1
  print(ans)
Buggy python submission (verdict: Runtime Error):
a=int(input())
print(a.count("1"))

Fixed submission:
print(input().count("1"))

Buggy python submission (verdict: Runtime Error):
a=int(input())
print(a.count(1))


Fixed submission:
print(input().count("1"))
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
hp = list(map(int,input().split()))
hp_sort = sorted(hp,reverse = True)
if K < len(hp):
    i = 0
    for i in range(K):
        del hp_sort[i]
    print(sum(hp_sort))
else:
    print('0')


Fixed submission:
N,K = map(int,input().split())
hp = list(map(int,input().split()))
hp_sort = sorted(hp)
if K < N:
    print(sum(hp_sort[0:N-K]))
else:
    print('0')

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
hp = list(map(int,input().split()))
hp_sort = sorted(hp,reverse = True)
if K < len(hp):
    for i in range(K):
        del hp_sort[i]
    print(sum(hp_sort))
else:
    print('0')


Fixed submission:
N,K = map(int,input().split())
hp = list(map(int,input().split()))
hp_sort = sorted(hp)
if K < N:
    print(sum(hp_sort[0:N-K]))
else:
    print('0')
Buggy python submission (verdict: Runtime Error):
c = input()
import string
alphStr = string.ascii_lowercase
print(alphStr.index(c)[alph+1])


Fixed submission:
c = input()
import string
alphStr = string.ascii_lowercase
alph = alphStr.index(c)
print(alphStr[alph+1])
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

if a-k>=0:
    print(int(a-k),int(b))
elif a+b<k:
    print(0,0)
else:
    print(0,int(a+b-k))

Fixed submission:
s, t = map(str, input().split())

print(str(t+s))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())
P = np.array(input().split(), dtype=int)
# 期待値に変換
Q = P/2 + 0.5
# 累積和をとる
S = Q.cumsum()
# K範囲での最大値
T = S[K:] - S[:-K]

print(max(T))

Fixed submission:
import numpy as np
N, K = map(int, input().split())
P = np.array(input().split(), dtype=int)
# 期待値に変換
Q = P/2 + 0.5
# 累積和をとる
S = Q.cumsum()
# K範囲での最大値
if N == K:
    print(S[-1])
else:
	T = S[K:] - S[:-K]
	print(max(T))
Buggy python submission (verdict: Runtime Error):
N = int(input())

import numpy as np

X = np.arange(N+1)
A = X.copy()

for i in [1,10,100,1000,10000]:
    A[i:i*10] = X[i:i*10] // i
B = X % 10
C = np.zeros((10,10), dtype=int)

for i in range(1,N+1):
    C[A[i], B[i]] += 1
count = 0

for i in range(10):
    for j in range(10):
        count += C[i][j] * C[j][i]
print(count)

Fixed submission:
N = int(input())

import numpy as np

X = np.arange(N+1)
A = X.copy()

for i in [1,10,100,1000,10000,100000]:
    A[i:i*10] = X[i:i*10] // i
B = X % 10

C = np.zeros((10,10), dtype=int)

for i in range(1,N+1):
    C[A[i], B[i]] += 1
count = 0

for i in range(10):
    for j in range(10):
        count += C[i][j] * C[j][i]

print(count)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

score = np.array([0, R, S, P], dtype=int)
M = (1 + (N-1)//K)
addi = M * K - N
t = np.array([{'n':0, 's':1, 'p':2, 'r':3}[i] for i in T+'n'*addi], dtype=int)

t = t.reshape(M,K).T

for i in range(K):
    for j in range(M):
        if j!=0 and t[i,j] == t[i,j-1]:
            t[i,j] = 0

print(score[t].sum())

Fixed submission:
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

import numpy as np

score = np.array([0, R, S, P], dtype=int)
M = (1 + (N-1)//K)
addi = M * K - N
t = np.array([{'n':0, 's':1, 'p':2, 'r':3}[i] for i in T+'n'*addi], dtype=int)

t = t.reshape(M,K).T

for i in range(K):
    for j in range(M):
        if j!=0 and t[i,j] == t[i,j-1]:
            t[i,j] = 0

print(score[t].sum())
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())

import math

print(A * B // math.gcd(A, B))

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

import fractions 

print(A * B // fractions.gcd(A, B))

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

import math

print(A * B // gcd(A, B))

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

import fractions 

print(A * B // fractions.gcd(A, B))
Buggy python submission (verdict: Runtime Error):
# E
import numpy as np
N, T = map(int, input().split())
# A=cost. B=value
A, B = np.array([input().split() for _ in range(N)], dtype=int).T

weight,value = A, B
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, まだ最後の食べ物を選んでない
d0 = np.zeros((N,T),int)
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, もう最後の食べ物を選んだ
d1 = np.zeros((N,T),int)
# 初期値として0番目の商品を加える
d0[0,weight[0]:] = value[0]
d1[0,:] = value[0]

for n in range(1, N):
  for w in range(T):
    if (w >= weight[n]):
      d0[n][w] = np.max(d0[n-1][w-weight[n]] + value[n], d0[n-1][w])
      d1[n][w] = np.max(d1[n-1][w-weight[n]] + value[n], d1[n-1][w], d0[n-1][w] + value[n])
    else:
      d0[n][w] = d0[n-1][w]
      d1[n][w] = np.max(d1[n-1][w], d0[n-1][w] + value[n])

print(d1[-1,-1])

Fixed submission:
# E
import numpy as np
N, T = map(int, input().split())
# A=cost. B=value
A, B = np.array([input().split() for _ in range(N)], dtype=int).T

weight,value = A, B
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, まだ最後の食べ物を選んでない
d0 = np.zeros((N,T),int)
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, もう最後の食べ物を選んだ
d1 = np.zeros((N,T),int)
# 初期値として0番目の商品を加える
d0[0,weight[0]:] = value[0]
d1[0,:] = value[0]

for n in range(1, N):
  w = weight[n]
  # w < weight[n]
  d0[n][:w] = d0[n-1][:w]
  d1[n][:w] = np.fmax(d1[n-1][:w], d0[n-1][:w] + value[n])
  # w >= weight[n]
  d0[n][w:] = np.fmax(d0[n-1][:-w] + value[n], d0[n-1][w:])
  d1[n][w:] = np.fmax(np.fmax(d1[n-1][:-w] + value[n], d1[n-1][w:]), d0[n-1][w:] + value[n])

print(d1[-1,-1])

Buggy python submission (verdict: Time Limit Exceeded):
# E
import numpy as np
N, T = map(int, input().split())
# A=cost. B=value
A, B = np.array([input().split() for _ in range(N)], dtype=int).T

weight,value = A, B
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, まだ最後の食べ物を選んでない
d0 = np.zeros((N,T),int)
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, もう最後の食べ物を選んだ
d1 = np.zeros((N,T),int)
# 初期値として0番目の商品を加える
d0[0,weight[0]:] = value[0]
d1[0,:] = value[0]

for n in range(1, N):
  for w in range(T):
    if (w >= weight[n]):
      d0[n][w] = max(d0[n-1][w-weight[n]] + value[n], d0[n-1][w])
      d1[n][w] = max(d1[n-1][w-weight[n]] + value[n], d1[n-1][w], d0[n-1][w] + value[n])
    else:
      d0[n][w] = d0[n-1][w]
      d1[n][w] = max(d1[n-1][w], d0[n-1][w] + value[n])

print(d1[-1,-1])

Fixed submission:
# E
import numpy as np
N, T = map(int, input().split())
# A=cost. B=value
A, B = np.array([input().split() for _ in range(N)], dtype=int).T

weight,value = A, B
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, まだ最後の食べ物を選んでない
d0 = np.zeros((N,T),int)
# dp[i][w] = i番目までからwを超えないように選んだ時の最大値, もう最後の食べ物を選んだ
d1 = np.zeros((N,T),int)
# 初期値として0番目の商品を加える
d0[0,weight[0]:] = value[0]
d1[0,:] = value[0]

for n in range(1, N):
  w = weight[n]
  # w < weight[n]
  d0[n][:w] = d0[n-1][:w]
  d1[n][:w] = np.fmax(d1[n-1][:w], d0[n-1][:w] + value[n])
  # w >= weight[n]
  d0[n][w:] = np.fmax(d0[n-1][:-w] + value[n], d0[n-1][w:])
  d1[n][w:] = np.fmax(np.fmax(d1[n-1][:-w] + value[n], d1[n-1][w:]), d0[n-1][w:] + value[n])

print(d1[-1,-1])
Buggy python submission (verdict: Runtime Error):
import sys

Weather = input()

if Weather = 'Sunny' :
  print('Cloudy')
elif Weather = 'Cloudy' :
  print('Rainy')
else :
  print('Sunny')
  



Fixed submission:

Weather = input()

if Weather == 'Sunny' :
  print('Cloudy')
elif Weather == 'Cloudy' :
  print('Rainy')
else :
  print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
#Nは参加人数,Kは初期ポイント、Qはクイズ回数
N ,K ,Q = map(int,input().split())

N_case =[]
i =0
while i <N :
  N_case.append(K)
  i+=1

j =0
while j <Q :
  k =0
  a = int(input())
  while k <N:
    N_case[k] -=1
    k+=1
  N_case[a-1] +=1
  j +=1


for n in N_case:
  if n>0:
    print('Yes')
  else:
    print('No')



Fixed submission:
#Nは参加人数,Kは初期ポイント、Qはクイズ回数
N ,K ,Q = map(int,input().split())

N_case =[]
i =0
while i <N :
  N_case.append(K-Q)
  i+=1

j =0
while j <Q :
  a = int(input())
  N_case[a-1] +=1
  j +=1


for n in N_case:
  if n>0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
day = input()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT',6}

print(7 - days[day])

Fixed submission:
day = input()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT':6}

print(7 - days[day])

Buggy python submission (verdict: Runtime Error):
day = input().rstrip()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT',6}

print (7 - days[day])

Fixed submission:
day = input()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT':6}

print(7 - days[day])

Buggy python submission (verdict: Runtime Error):
day = input()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT',6}

print (7 - days[day])

Fixed submission:
day = input()

days = {'SUN':0, 'MON':1, 'TUE':2, 'WED':3, 'THU':4, 'FRI': 5,'SAT':6}

print(7 - days[day])
Buggy python submission (verdict: Runtime Error):
x = input()

a, b = x.split()
a = list(a)
b = int(b)

a[b] = a[b].lower()

print("".join(a))



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

n, k = x.split()
k = int(k)
s = list(s)

s[k-1] = s[k-1].lower()

print("".join(s))
Buggy python submission (verdict: Runtime Error):
X, Y, Z = input()
print(Z X Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print (Z, X, Y)
Buggy python submission (verdict: Runtime Error):
# coding:utf8
S = input()

if S == hi or S ==hihi or S=hihih or S=hihihihi or S=hihihihihi:
    print("Yes")
else :
    print("No")
    

Fixed submission:
# coding:utf8
S = input()

if S == "hi" or S =="hihi" or S=="hihihi" or S=="hihihihi" or S=="hihihihihi":
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
ana=N//(A+B)*A
rem=N%(A+B)
ana=ana+rem.count(A)
print(ana)

Fixed submission:
N,A,B=map(int,input().split())
ana=N//(A+B)*A
rem=N%(A+B)
ana=ana+min(rem,A)
print(ana)
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==int(i*0.1) :
    print(i)
    exit()
plint("-1")


Fixed submission:
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==int(i*0.1) :
    print(i)
    exit()
print("-1")

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==(i*0.1) :
    print(i)
    exit()
plint("-1")

Fixed submission:
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==int(i*0.1) :
    print(i)
    exit()
print("-1")

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
N<10000
N*8/100==A
N*10/100==B
print(N)

Fixed submission:
A,B=map(int,input().split())
for i in range(10000):
  if A==int(i*0.08) and B==int(i*0.1) :
    print(i)
    exit()
print("-1")
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if (a==b or b==c or c==a) :
  if a==B==C:
    print("No")
  else :
    print("Yes")

else :
    print("No")

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

else :
    print("No")
Buggy python submission (verdict: Runtime Error):
S=input()

if S=="Sunny" :
  print("Cloudy")
else :
  if S=="Cloudy" :
    print("Rainy")
  else S="Rainy" :
    print("Sunny")

Fixed submission:
S=input()

if S=="Sunny" :
  print("Cloudy")
else :
  if S=="Cloudy" :
    print("Rainy")
  else :
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
def gcd(x,y):
    if x > y:
        a = x
        b = y
    else:
        a = y
        b = x
    while a % b != 0:
        b = a % b
        a = b
    return b

input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))


def lcmbase(x, y):
    return x * y / gcd(int(x), int(y))

def lcm(num):
    buf = num[0]
    for i in range(1, len(num)):
        buf = lcmbase(num[i], buf)
    return buf

usedata = int(lcm(data) - 1)

suming = 0
for i in data:
    suming += usedata % i

print(suming)

Fixed submission:
input()
ip = input().split()
data = []
ans = 0
for i in ip:
    ans += int(i) - 1

print(ans)

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

input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))


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

def lcm(num):
    buf = num[0]
    for i in range(1, len(num)):
        buf = lcmbase(num[i], buf)
    return buf

usedata = int(lcm(data) - 1)

suming = 0
for i in data:
    suming += usedata % i

print(suming)

Fixed submission:
input()
ip = input().split()
data = []
ans = 0
for i in ip:
    ans += int(i) - 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))

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

def lcm(num):
    return reduce(lcmB,num)

print(int(lcm(data) - 1))

Fixed submission:
input()
ip = input().split()
data = []
ans = 0
for i in ip:
    ans += int(i) - 1

print(ans)
Buggy python submission (verdict: Runtime Error):
#A = 初期値　B = 一日の購入　C = 乳化のボーダー　D =在庫の増やす数

#A > B
#D % B >= B - C

size = int(input())
data = []
flag = 0

for i in range(size):
    ip = input().split()
    data = []
    for j in ip:
        data.append(int(j))
    #定義
    buf = []
#    print(store,buy,bord,charge,buf)
    #最初の処理
    data[0] = data[0] % data[1]
    if data[0] > data[3]:
        flag = 1
    #定常処理
    while data[0] not in buf:
        buf.append(data[0])
        data[0] = (data[0] + data[3]) % data[1]
        if data[0] > data[3]:
            flag = 1
            break
 #   print(buf)
    if flag == 1:
        print("No")
        flag = 0
    else:
        print("Yes")


Fixed submission:
input()
ip = input().split()
data = []
for i in ip:
    data.append(int(i))

buf = -1
enc = 0
for i in data:
    if buf == i:
        enc += 1
        buf = -1
    else:
        buf = i

print(enc)
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
n = (y if x < y else x) 
array = []
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
array.reverse()
print(array[z-1])


Fixed submission:
x,y,z = map(int,input().split())
n = (y if x < y else x) 
n += 1
array = [1]
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
array.reverse()
print(array[z-1])

Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
n = (y if x < y else x) 
array = []
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
print(array[z-1])


Fixed submission:
x,y,z = map(int,input().split())
n = (y if x < y else x) 
n += 1
array = [1]
for i in range(1,n):
	if (x%i==0 and y%i==0):
		array.append(i)
array.reverse()
print(array[z-1])
Buggy python submission (verdict: Runtime Error):
let test a b =
  max (max (a+b) (a-b)) (a*b);;

Scanf.sscanf (read_line ()) "%d %d" (fun a b -> test a b);;

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

X = K+N
Y = K-N
Z = K*N

print(max(X,Y,Z))
Buggy python submission (verdict: Runtime Error):
n,k=input().split(" ")
n=int(n)
k=int(k)
arr=[0]+[int(i) for i in input().split(" ")]
dp=[0]*(n+1)
for i in range(n-1,0,-1):
    min1=1000000007;
    for j in range(i+1,min(n+1,i+k+1)):
        x=dp[j]+abs(arr[i]-arr[j])
        if(x<min1):
            min1=x
    dp[i]=min1
print(dp[1])


Fixed submission:
n=int(input())
arr=[]
arr=[0]+[int(i) for i in input().split(" ")]
dp=[0]*(n+1)
dp[n]=0
dp[n-1]=abs(arr[n-1]-arr[n])
for i in range(n-2,0,-1):
    dp[i]=min( dp[i+1]+abs(arr[i]-arr[i+1]) , dp[i+2]+abs(arr[i]-arr[i+2]) )
print(dp[1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
arr=[]
arr=[int(i) for i in input().split(" ")]
arr=[0]+arr

def dp(x):
    if (x==n):
        return 0
    if(x==n-1):
        return (abs(arr[n]-arr[x]))
    return (min(  dp(x+1)+abs(arr[x]-arr[x+1]), dp(x+2)+abs(arr[x]-arr[x+2]) ))

print(dp(1))




Fixed submission:
n=int(input())
arr=[]
arr=[0]+[int(i) for i in input().split(" ")]
dp=[0]*(n+1)
dp[n]=0
dp[n-1]=abs(arr[n-1]-arr[n])
for i in range(n-2,0,-1):
    dp[i]=min( dp[i+1]+abs(arr[i]-arr[i+1]) , dp[i+2]+abs(arr[i]-arr[i+2]) )
print(dp[1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

count = 0
if len([i for i in A if i%2 == 0 ]) ==0:
    print("APPROVED")
else:
    a = [i for i in A if i%2 == 0 ]
    for j in a:
        if j%3 == 0 or j%5 == 0:
            count += 1
    
if count == len(a):
    print("APPROVED")

else:
    print("DENIED")

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

count = 0
for i in A:
    if i%2 == 0 and i%3 != 0 and i%5 != 0:
        print("DENIED")
        break
    count += 1

if count == len(A):
    print("APPROVED")
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
H = list(map(int, input().split()))

HP = sum(H)
count = 0
Z = 0
if K >= len(H):
    print(0)

else:
    for k in range(K):
        Z += sorted(H, reverse=True)[k]
    hp = HP - Z
    print(hp)

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

HP = sum(H)
ld = sorted(H , reverse=True)
if K >= len(H):
    print(0)

else:
    Z = sum(ld[:K])
    hp = HP - Z
    print(hp)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
H = list(map(int, input().split()))

HP = sum(H)
count = 0
Z = 0
if K >= len(H):
    print(0)

else:
    for k in range(K):
        Z += sorted(H, reverse=True)[k]
    hp = HP - Z
    while(hp > 0):
        hp = hp - 1
        count += 1
    print(count)

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

HP = sum(H)
ld = sorted(H , reverse=True)
if K >= len(H):
    print(0)

else:
    Z = sum(ld[:K])
    hp = HP - Z
    print(hp)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

score = 0
for i in range(0,N-1):
    if A[i+1] - A[i] == 1:
        score += C[A[i] - 1]

print(score + sum(B))

Fixed submission:
N = int(input())
print(N**3)
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
A,B=map(int,input().split())
print("Yay!" if a <= 8 and b <= 8 else ":(")

Fixed submission:
A,B=map(int,input().split())
print("Yay!" if A<9 and B<9 else ":(")

Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print("Yay!" if a <= 8 and b <= 8 else ":(")

Fixed submission:
A,B=map(int,input().split())
print("Yay!" if A<9 and B<9 else ":(")
Buggy python submission (verdict: Runtime Error):
#NとKに数値入る                                                                                                                   N,K = map(int, input().split())

#before_strに文字列
before_str = input()

str_list = list(before_str)
str_list[K-1] = str_list[K-1].swapcase()

after_str = ''.join(str_list)

print(after_str)

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

str_list = list(before_str)
str_list[K-1] = str_list[K-1].swapcase()

after_str = ''.join(str_list)

print(after_str)
Buggy python submission (verdict: Runtime Error):
a= input()
b= input()
c= input()
str = a[0] + b[0] + c[0]
print(str)

Fixed submission:
S = input().split()
str = S[0][0] + S[1][0] + S[2][0]
print(str.upper())

Buggy python submission (verdict: Runtime Error):
a= input()
b= input()
c= input()
str = a[0] + b[0] + c[0]
print(str)

Fixed submission:
S = input().split()
str = S[0][0] + S[1][0] + S[2][0]
print(str.upper())

Buggy python submission (verdict: Runtime Error):
s = input().split()
str = s[0][0] + s[1][0] + s[2][0]
print(str.upper())

Fixed submission:
S = input().split()
str = S[0][0] + S[1][0] + S[2][0]
print(str.upper())
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
N = abs(N - K)
while true:
  if N =< K:
    N = (N - K)
    break
    
print(abs(N))

Fixed submission:
n, k = map(int, input().split())
if n==0 or k==1:
    print(0)
    exit()
elif n<k:
    print(min(n, abs(n-k)))
    exit()
elif n % k == 0:
    print(0)
    exit()
else:
    mx = n%k
print(min(abs(mx-k), mx))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
result = []
while N > 0
    M -= abs(N - M)
    result.append(M)
print(min(result))

Fixed submission:
n, k = map(int, input().split())
if n==0 or k==1:
    print(0)
    exit()
elif n<k:
    print(min(n, abs(n-k)))
    exit()
elif n % k == 0:
    print(0)
    exit()
else:
    mx = n%k
print(min(abs(mx-k), mx))

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
Print(abs((N-M))-N)

Fixed submission:
n, k = map(int, input().split())
if n==0 or k==1:
    print(0)
    exit()
elif n<k:
    print(min(n, abs(n-k)))
    exit()
elif n % k == 0:
    print(0)
    exit()
else:
    mx = n%k
print(min(abs(mx-k), mx))
Buggy python submission (verdict: Runtime Error):
usr = eval(input())
if usr[-1] == usr[-2] and usr[-3] == usr[-4]:
    print('Yes')
else:
    print('No')

Fixed submission:
s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
user_input = eval(input())
print((user_input // 500) * 1000 + ((user_input % 500) // 5) * 5)

Fixed submission:
s = input()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")