TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)
if K <= N and K != 0:
    H.remove(H[:K])
elif K > N and K != 0:
    H.clear()
print(sum(H))

N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)
if K == 0:
    pass
elif K <= N:
    H = H[(K+1):]
elif K > N:
    H.clear()
print(sum(H))

N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)
if K == 0:
    pass
elif K > N:
    H.clear()
else:
    H = H[(K+1):]
s = sum(H)
print(s)

N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
if K == 0:
    pass
elif K > N:
    H.clear()
else:
    H = H[:-K]
print(sum(H))

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k=map(int,input().split())
H=list(map(int,input().split()))
H2=H[::-1]
for i in range(k):
    if len(H2)>0:
        H2.pop(len(H2)-1)
print(sum(H2))

n,k=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
if n>k:
    for i in range(k):
        H.pop(n-i-1)
    ans=sum(H)
else:
    ans=0
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
h = sorted(map(int, input().split()))
 
x = 0
print(h)
if n - k <= 0:
    print(0)
else:
    for i in range(n-k):
        x += h[i]
    print(x)

n, k = map(int, input().split())
h = sorted(map(int, input().split()))
 
x = 0

if n - k <= 0:
    print(0)
else:
    for i in range(n-k):
        x += h[i]
    print(x)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
#print("n={}, k={}".format(n,k))

h = input().split()
#print(h)

hs = sorted(h)
#print(hs)


if n >= k: 
  num_mon = n - k 
else:
  num_mon = 0
print(num_mon)


mon_att = hs[0:num_mon]
print(mon_att)


min_att = sum(map(int, mon_att))
print(min_att)

n, k = map(int, input().split())
#print("n={}, k={}".format(n,k))

h = input().split()
#print(h)

hs = sorted(h)
#print(hs)


mon_att = hs[0:len(hs)+1-k]
#print(mon_att)


min_att = sum(map(int, mon_att))
print(min_att)

n, k = map(int, input().split())
#print("n={}, k={}".format(n,k))

A = list(map(int, input().split()))
#print(h)

A.sort(reverse=True)
#print(hs)

print(sum(A[k:]))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n , k = map(int, input().split())
hp = list(map(int, input().split()))

sum_hp = 0

print(hp)
hp.sort()
print(hp)

for i in range(k):
    if(len(hp)> 0):
        hp.pop()

print(hp)

for j in hp:
    sum_hp = sum_hp + int(j)

print(str(sum_hp))

n , k = map(int, input().split())
hp = list(map(int, input().split()))

sum_hp = 0


hp.sort()


for i in range(k):
    if(len(hp)> 0):
        hp.pop()



for j in hp:
    sum_hp = sum_hp + int(j)

print(str(sum_hp))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
temp = input().split(' ')
monter_count = int(temp[0])
kill_count = int(temp[1])

temp = input().split(' ')

temp = [int(s) for s in temp]

temp.sort(reverse=True)
del(temp[0:monter_count])
print(temp.sum())

import math

temp = input().split(' ')
monter_count = int(temp[0])
kill_count = int(temp[1])
 
temp = input().split(' ')

temp = [int(s) for s in temp]

temp.sort(reverse=True)
del(temp[0:kill_count])

print(sum(temp))

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N,K = map(int,input().split())
H = input().split()
H = [int h for h in H]
H = sorted(H)

if N > K:
    print(K + sum(H[:H-K]))
else:
    print(K)


N,K = map(int,input().split())
H = list(map(int, input().split()))
H  = sorted(H)


if N > K:
    print(sum(H[:N-K]))
else:
    print(0)


Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
from heapq import heapify, heappop
from math import ceil
N, K = map(int, input().split())
H = list(map(int, input().split()))
Hminus = list(map(lambda x: x*(-1), H))
Hheap = heapify(Hminus)
for _ in range(K):
    heappop(Hheap)
print(sum(Hheap))

from heapq import heapify, heappop
from math import ceil
N, K = map(int, input().split())
H = list(map(int, input().split()))
# N=8
# K=9
# H=[7, 9, 3, 2, 3, 8, 4, 6]

Hminus = list(map(lambda x: x*(-1), H))
# print(type(Hminus))
heapify(Hminus)
# print(Hminus)
if K > len(H):
    print(0)
else:
    for _ in range(K):
        heappop(Hminus)
    print(sum(Hminus)*(-1))

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
import math

n,k=map(int,input().split())
enemys = list(map(int,input().split()))

enemys.sort(reverse=True)
count = 0
for e in enemys:
  if(k > 0):
    count += 1
    k -= 1
  else:
    count += e

print(count)



import math

n,k=map(int,input().split())
enemys = list(map(int,input().split()))

enemys.sort(reverse=True)
count = 0
for e in enemys:
  if(k > 0):
    k -= 1
  else:
    count += e

print(count)



Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
import sys
input = sys.stdin.buffer.readline
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n, k = MAP()
h = LIST()
h.sort()

if k >= n:
    print(0)
else:
    print(sum(h[k:]))

import sys
input = sys.stdin.buffer.readline
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

n, k = MAP()
h = LIST()
h.sort(reverse=True)

if k >= n:
    print(0)
else:
    print(sum(h[k:]))


Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
# -*- coding: utf-8 -*-
n,k=map(int, input().split())
h=list(map(int, input().split()))
b =sorted(h)[0:-n]


print(sum(b))

# -*- coding: utf-8 -*-
n,k=map(int, input().split())
h=list(map(int, input().split()))
b =sorted(h)
if k != 0:
    b = b[:-k]

print(sum(b))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k = map(int, input().split())
L = list(map(int,input().split()))
ans = 0
S = sorted(L,reverse=True)
print(S)
for i in range(n):
    if k > 0:
       # ans += 1 
       k = k-1
    elif k == 0:
        ans = ans+S[i]
print(ans)

n,k = map(int, input().split())
L = list(map(int,input().split()))
ans = 0
S = sorted(L)
print(S)
for i in range(n):
    if k > 0:
        del S[-1]
        k = k-1
print(S)
print(sum(S))

n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:print(0);exit()
h.sort(reverse=1)
print(sum(h[k:]))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
ls = list(map(int, input().split()))

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    
    left = arr[:mid]
    right = arr[mid:]

    
    left = merge_sort(left)
    right = merge_sort(right)

    
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    
    while l_i < len(left) and r_i < len(right):
        
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

ll = merge_sort(ls)
print(sum(ll[:n-k-1]))

n, k = map(int, input().split())
ls = list(map(int, input().split()))

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    
    left = arr[:mid]
    right = arr[mid:]

    
    left = merge_sort(left)
    right = merge_sort(right)

    
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    
    while l_i < len(left) and r_i < len(right):
        
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

ll = merge_sort(ls)
if n <= k:
    print(0)
else:
    print(sum(ll[:n-k]))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
#n = int(input())
n,k = map(int,input().split())
h_L = list(map(int,input().split()))

h_L.sort(reverse=True)
#print(h_L)
if k ==0:
    print(sum(h_L))
else:
    print(sum(h_L[k+1:]))

#n = int(input())
n,k = map(int,input().split())
h_L = list(map(int,input().split()))

h_L.sort(reverse=True)
#print(h_L)
if k ==0:
    print(sum(h_L))
else:
    print(sum(h_L[k:]))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = map(int,input().split())
H = list(map(int,input().split()))
result = 0
if len(H) <= K:
    print(result)
else:
    H.sort()
    result = sum(H[0:N-K-1])
    print(result)

N, K = map(int,input().split())
H = list(map(int,input().split()))
result = 0
if len(H) <= K:
    print(result)
else:
    H.sort()
    result = sum(H[0:N-K])
    print(result)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = map(int, input().split())
H = sorted(list(map(int, input().split())), reverse=True)
if N <= K:
    print(0)
else:
    print(sum(H[K:-1]))

N, K = map(int, input().split())
H = [int(N) for N in input().split()]
H.sort(reverse=True)
if N <= K:
    print(0)
else:
    for i in range(0, K):
        H[i] = 0
    print(sum(H))


Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort(reverse=True)
n[0:b-1]=[]
print(sum(n))  


a,b=map(int,input().split())
n=list(map(int,input().split()))
n.sort(reverse=True)
n[0:b]=[]
print(sum(n))  


Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
s = []
for i in range(2):
    s.append(input().split())
n = int(s[0][0])
k = int(s[0][1])
answer = 0
hs = s[1]
print(hs)
h = [int(a) for a in hs]
print(h)
h.sort()
print(h)
h.reverse()
if(k<n):
    for i in range(k,n):
        answer = answer + h[i]
print(answer)

s = []
for i in range(2):
    s.append(input().split())
n = int(s[0][0])
k = int(s[0][1])
answer = 0
hs = s[1]
h = [int(a) for a in hs]
h.sort()
h.reverse()
if(k<n):
    for i in range(k,n):
        answer = answer + h[i]
print(answer)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
print(sum(H[:1-K]))

N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
print(sum(H[K:]))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
import sys

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    K = int(next(tokens))
    H_list = []
    for i in range(N):
        H_list.append(int(next(tokens)))

    solve(N, K, H_list)

def solve(H: int, N: int, H_list: list):
    H_ranking_list = sorted(H_list, reverse=True)
    if N != 0:
        H_ranking_list = H_ranking_list[N-1:]

    count = sum(H_ranking_list)

    print(count)

    return
 
if __name__ == "__main__":
    propare()

import sys

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    K = int(next(tokens))
    H_list = []
    for i in range(N):
        H_list.append(int(next(tokens)))

    solve(N, K, H_list)

def solve(H: int, N: int, H_list: list):
    H_ranking_list = sorted(H_list, reverse=True)
    H_ranking_list = H_ranking_list[N:]

    count = sum(H_ranking_list)

    print(count)

    return
 
if __name__ == "__main__":
    propare()

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
ans=0
for i in range(k):
  ans+=h[i]
print(ans)

n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
ans=0
if k>=n:
  print(0)
else:
  for i in range(n-k):
    ans+=h[i]
  print(ans)

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if n-k+1 <= 0:
  print(0)
  quit()
else:
  L = l[0:n-K+1]
  L_sum = sum(L)
  print(L_sum)

n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[0:n-K+1]
L_sum = sum(L)
print(L_sum)

n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[0,n-K+1]
L_sum = sum(L)
print(L_sum)

n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if len(l) > k:
    print(sum(l[:n-k]))
else:
    print(0)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverce=True):
ans = 0
if(k>=n):
  ans = 0
else:
  for i in range(k,n):
    ans += h[i]
print(ans)


n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True):
ans = 0
for i in range(k,n):
  ans += h[i]
print(ans)


n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse==True):
ans = 0
for i in range(k,n):
  ans += h[i]
print(ans)

n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverce=True)
ans = 0
if(k>=n):
  ans = 0
else:
  for i in range(k,n):
    ans += h[i]
print(ans)


n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
ans = 0
if(k>=n):
  ans = 0
else:
  for i in range(k,n):
    ans += h[i]
print(ans)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = map(int, input().split())
H = sorted([int(x) for x in input().split()])[::-1]
print(sum(H[N:]))


N, K = map(int, input().split())
H = sorted([int(x) for x in input().split()])[::-1]
print(sum(H[K:]))


Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
s = input().split()
N = int(s[0])
K = int(s[1])

H = input().split()

H_s = sorted(H, reverse=True)
H_s[:N] = 0

print(sum(H_s))


s = input().split()
N = int(s[0])
K = int(s[1])

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

H_s = sorted(H, reverse=True)
H_s[:N] = 0

print(sum(H_s))


s = input().split()
N = int(s[0])
K = int(s[1])

H = list(map(int, input().split()))
H_s = sorted(H, reverse=True)

print(sum(H_s[K:]))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
a,b = map(int,input().split())
N = list(map(int,input().split()))
N.sort()
print(sum(N))

a,b = map(int,input().split())
N = list(map(int,input().split()))
N.sort()
for i in range(b):
    if N:
        N.pop()
print(sum(N))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k,*a=map(int,open(0).read().split())
a.sort()
a+=[0]
print(sum(a[:~k])+k)

n,k,*a=map(int,open(0).read().split())
a.sort()
a+=[0]
print(sum(a[:~k]))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = [int(_) for _ in input().split()]
H = [int(_) for _ in input().split()]
list_H = sorted(H, reverse=True)
for k in range(K):
    list_H.pop(k)
attack = 0
for i in H:
    attack += i
print(attack)


N, K = [int(_) for _ in input().split()]
H = [int(_) for _ in input().split()]
H.sort(reverse=True)
print(sum(H[K:]))


Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k = map(int,input().split())
h = list(map(input().split())
h.sort()
ans = int(0)
if k >= n:
    print(ans)
else:
    for i in range(n - k):
        ans += int(h[i])
    print(ans)

n,k = map(int,input().split())
h = list(input().split())
h.sort()
ans = int(0)
if k>=n:
  print(ans)
else:
	for i in range(n - k):
    	ans += int(h[i])
	print(ans)


n,k = map(int,input().split())
h = list(map(input().split()))
h.sort()
ans = int(0)
for i in range(len(h) - k):
    ans += int(h[i])
print(ans)

n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort()
ans = int(0)
for i in range(len(h) - k):
    ans += int(h[i])
print(ans)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
import math

def main():
  N, K = map(int, input().split())
  H = list(map(int, input().split()))
  
  if K >= N:
    print(0)
    return
  
  ans = 0
  l = sorted(H, reverse=True)
  
  del l[:K]
  print(l)
  
  ans += sum(l)
  
  print(ans)
  
  
main()

import math

def main():
  N, K = map(int, input().split())
  H = list(map(int, input().split()))
  
  if K >= N:
    print(0)
    return
  
  
  l = sorted(H, reverse=True)
  
  
  # print(l)
  
  # ans += sum(l)
  
  print(sum(l[K:]))
  #print(ans)
  
  
main()

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
if K>=N:
  print(0)
else:
  H=H[K:]
  print(sum(H))

N,K=map(int,input().split())
H=list(map(int,input().split()))
H.sort()
if K>=N:
  print(0)
elif K==0:
  print(sum(H))
else:
  H=H[:-K]
  print(sum(H))


Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = map(int, input().split())
H = input().split()
total=0

if(K==len(H)):
  print(0)
else:
  temp = sorted(H)
  while K>0:
    temp=temp[:-1]
    K-=1
  for i in temp:
    total+=i
  print(total)
  

N, K = map(int, input().split())
Hs = map(int,input().split())
print(sum(sorted(Hs, reverse=True)[K::]))

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort(reverse=True)
count = 0

for hp in h:
    if k >= 1:
        k -= 1
        h.pop(0)
    else:
        count += hp

print(count)

n, k = map(int, input().split())
h = list(map(int, input().split()))


h.sort()
count = 0
n -= k
if n <= 0:
    print('0')
else:
    for i in range(n):
        count += h[i]

    print(count)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = list(map(int64_t,input().split()))
k = K - 1
H = list(map(int64_t,input().split()))
Hs = sorted(H,reverse = True)
for i in range(0,K):
  Hs[i] = 0
print(sum(Hs))

N, K = list(map(int,input().split()))
k = K + 1
hp = 0
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
for i in range(0,K):
  Hs[i] = 0
for i in range(k,N):
  hp += Hs[i]

N, K = list(map(int,input().split()))
k = K - 1
H = list(map(int,input().split()))
Hs = sorted(H,reverse = True)
if K <= N:
  for i in range(0,K):
    Hs[i] = 0
  print(sum(Hs))
if K > N:
  print(0)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
x = input().split(" ")
n = int(x[0])
k = int(x[1])
h = list(map(int,input().split(" ")))

h.sort(reverse=True)
print(h)

ans = 0
if k >= n:
    print(0)
else:
    for i in range(k,n):
        ans += h[i]
    print(ans)

x = input().split(" ")
n = int(x[0])
k = int(x[1])
h = list(map(int,input().split(" ")))

h.sort(reverse=True)

ans = 0
if k >= n:
    print(0)
else:
    for i in range(k,n):
        ans += h[i]
    print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N,K = map(int, input().split())
H = list(map(int, input().split()))

H.sort(reverse=True)

if N <= K:
  print(0)
else:
  del l[0:K]
  print(sum(H))

N,K = map(int, input().split())
H = list(map(int, input().split()))
 
H.sort(reverse=True)
 
if N <= K:
  print(0)
else:
  del H[0:K]
  print(sum(H))

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
import math

n, k = [int(x) for x in input().split()]

h_n = list(map(int, input().split()))

if n <= k:
    print("0")

s_n = sorted(h_n)

log_sum = math.log(sum(s_n[:n - k]))

print(math.exp(log_sum))

n, k = [int(x) for x in input().split()]

h_n = list(map(int, input().split()))

if n <= k:
    print("0")
else:
    s_n = sorted(h_n, reverse=True)

    print(sum(s_n[:n - k]))

n, k = [int(x) for x in input().split()]

h_n = list(map(int, input().split()))

if n <= k:
    print("0")
else:
    print(sum(sorted(h_n)[:n - k]))

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
a, b=map(int,input().split())
l=list(map(int,input().split()))
if a<b:
  print(0)
elif a>b:
  l.sort()
  n=l[b:]
  s=sum(n)
  print(s)

a, b=map(int,input().split())
l=list(map(int,input().split()))
if a<=b:
  print(0)
elif a>b:
  l.sort(reverse=True)
  n=l[b:]
  s=sum(n)
  print(s)


Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
h = list(map(int,input().split()))

h.sort(reverse = True)
for i in range(k-1):
    h[i] = 0
print(sum(h))

n, k = map(int, input().split())
h = list(map(int,input().split()))

h.sort(reverse = True)
print(sum(h[k::]))

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h_ = sorted(h)

for i in range(k):
    h_.pop()

s = [0]*(len(h_)+1)
for j in range(len(h_)):
    s[i+1] = s[i] + h_[i]

print(s[-1])

n, k = map(int, input().split())
h = list(map(int, input().split()))
 
h_ = sorted(h)
 
for i in range(k):
    if len(h_) > 0:
        h_.pop()
    
s = [0]*(len(h_)+1)
for j in range(len(h_)):
    s[j+1] = s[j] + h_[j]

print(s[-1])

Verdicts: Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h = sorted(h)
H = h[k:]
sum_ = sum(H)
print(sum_)

n, k = map(int, input().split())
h = list(map(int, input().split()))

h = sorted(h, reverse=True)
H = h[k:]
sum_ = sum(H)
print(sum_)

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N, K = list(map(int, input().split()))
H = list(map(int, input().split()))

print(sorted(H)[::-1][K:])

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

print(sum(sorted(H)[::-1][K:]))

Verdicts: Wrong Answer

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys)
if K >= len(enemys):
  print(0)
else:
  enemys = enemys[K:]
  print(sum(enemys))

N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys,reverse = True)
if K >= len(enemys):
  print(0)
else:
  enemys = enemys[K+1:]
  print(sum(enemys))

N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys,reversed = True)
if K >= len(enemys):
  print(0)
else:
  enemys = enemys[K+1:]
  print(sum(enemys))

N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys,reverse = True)
if K >= N:
  print(0)
elif K == 0:
  print(sum(enemys))
else:  
  enemys = enemys[K:]
  print(sum(enemys))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: Fennec is fighting with N monsters.  The _health_ of the i-th monster is H_i.  Fennec can do the following two actions:    * Attack: Fennec chooses one monster. That monster's health will decrease by 1.   * Special Move: Fennec chooses one monster. That monster's health will become 0.  There is no way other than Attack and Special Move to decrease the monsters' health.  Fennec wins when all the monsters' healths become 0 or below.  Find the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.

Submission attempts (in order):
n,k = map(int, input().split())
h = list(map(int, input().split()))
hsorted = sorted(h)
if k>=n:
    print(0)
else:
    print(sum(hsorted[k:n]))

n,k = map(int, input().split())
h = list(map(int, input().split()))
hsorted = sorted(h, reverse=True)
if k>=n:
    print(0)
else:
    print(sum(hsorted[k:n]))

Verdicts: Wrong Answer

Accepted