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

@jit
def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()


Fixed submission:
import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()

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

@jit
def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()

Fixed submission:
import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import jit
  
data = np.array(input().split(" "), dtype="int")
life = np.array(input().split(" "), dtype="int")
@jit
def calculation(data, life):
    monsters = data[0]
    smash = data[1]
    a = np.sort(life)
    if smash >= len(a):
        print(0)
    elif smash == 0:
        print(np.sum(a))
    else:
        leftover = np.where(a[-smash] > a, a, 0)
        print(np.sum(leftover))

calculation(data, life)

Fixed submission:
import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import jit
  
data = np.array(input().split(" "), dtype="int")
life = np.array(input().split(" "), dtype="int")
@jit
def calculation(data, life):
    monsters = data[0]
    smash = data[1]
    a = np.sort(life)
    leftover = np.where(a[-smash] > a, a, 0)
    print(np.sum(leftover))

calculation(data, life)

Fixed submission:
import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()

Buggy python submission (verdict: Time Limit Exceeded):
data = input().split()
monsters = int(data[0])
smash = int(data[1])

mon_str = input().split()
mon_str = [int(b) for b in mon_str]
count = 0

for i in range(smash):
    try:
        enemy = mon_str.index(max(mon_str))
        del mon_str[enemy]
    
    except ValueError:
        pass
print(sum(mon_str))

Fixed submission:
import numpy as np

def do():
    data = np.array(input().split(" "), dtype="int64")
    life = np.array(input().split(" "), dtype="int64")
    monsters = data[0]
    smash = data[1]
    if smash == 0:
        print(np.sum(life))
    elif smash >= monsters:
        print(0)
    else:
        a = np.sort(life)[-smash]
        leftover = np.where(life < a, life, 0)
        print(np.sum(leftover))

do()