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_ls = list(map(int, input().split(' ')))
H_ls.sort()
print(sum(H_ls[K:]))

N, K = map(int,input().split(' '))
H_ls = list(map(int, input().split(' ')))
print(sum(H_ls[K:]))

N, K = map(int, input().split(' '))
H_ls = list(map(int, input().split(' ')))
H_ls.sort(reverse=True)
print(sum(H_ls[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):
def f(h,k):
    N=len(h)
    t=0
    h.sort()
    for i in range(k-1):
        t+=h[i]
    return sum(h)-t
N,k=map(int,input().split())
h=list(map(int,input().split()))
print(f(h,k))

        

def f(h,k):
    N=len(h)
    t=0
    h.sort()
    for i in range(N-k):
        t+=h[i]
    return t
N,k=map(int,input().split())
h=list(map(int,input().split()))
print(f(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 = tuple(map(int, input().split(' ')))
hs = list(map(int, input().split(' ')))
if k>=n:
    print(0)
    return
hs = sorted(hs)
print(sum(hs[:n-k]))


n, k = tuple(map(int, input().split(' ')))
hs = list(map(int, input().split(' ')))
if k>=n:
    print(0)
    exit()
hs = sorted(hs)
print(sum(hs[:n-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()))
print(H)
for i in range(min(K,N)):
    saidai = max(H)
    H.remove(saidai)
print(H)

print(sum(H))

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

Hsort = sorted(H, reverse=True)

Huse = Hsort[K:]


print(sum(Huse))

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()))

#print(n)
a = list(map(int, input().split()))

sum = 0
a.sort()
print(a)
for i in range(min(n,k)): a.pop()
#print(a)
for i in range(len(a)):
    sum += a[i]
print(sum)


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

#print(n)
a = list(map(int, input().split()))

sum = 0
a.sort()
#print(a)
for i in range(min(n,k)): a.pop()
#print(a)
for i in range(len(a)):
    sum += a[i]
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):
h = int(input())
mem = [0] * 100
cnt = 0
 
def atk(k):
    if k == 1:
        mem[1] = 1
        return 1
    else:
        j = int(k // 2)
        l = 0
        while k / ( 2 ** l) >1:
            l += 1
 
        if mem[l] == 0:
            mem[l] = atk(j) * 2 + 1
            return mem[l]
        else:        
            return mem[l]

atk(h)
mem.sort(reverse = True)
print(mem[0])


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

h.sort(reverse = True)

if k > n:
  k = n

for i in range(k):
  h[i] = 0

ans = 0
for i in range(n):
  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())
H=list(map(int,input().split()))
HP=sorted(H)
for i in range(K):
  del HP[0]
print(sum(HP))

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


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())
m = list(map(int,input().split()))
m.sort(reverse=True)
print(k+sum(m[k:]))


n,k=map(int,input().split())
m = list(map(int,input().split()))
m.sort(reverse=True)
print(sum(m[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()))
i = 0
count = 0
while sum(H[N-K]) == 0:
  while H[N-K] == 0:
    count += 1
    while i <= N-K:
      i += 1
print(count)

N,K = map(int,input().split())
H = list(map(int,input().split()))
h = H.sort()
i = 0
count = 0
while sum(h[N-K]) == 0:
  while h[N-K] == 0:
    count += 1
    while i <= N-K:
      i += 1
print(count)

N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort(reverse=True)
 
sum = 0
for count in range(N):
        if count >= K:
            sum += H[count]
 
print(sum)

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):
N, K = map(int, input().split())
A = list(map(int, input().split()))
listsort=sorted(A, reverse=True)
print(listsort)
del listsort[0:K]
print(sum(listsort))

N, K = map(int, input().split())
A = list(map(int, input().split()))
listsort=sorted(A, reverse=True)
del listsort[0:K]
print(sum(listsort))

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):
feneck = input().split()
H = input().split()
H_i = [int(h) for h in H]

N = int(feneck[0])
K = int(feneck[1])

list.sort(H_i, reverse=True)

if K < len(H):
  sum = 0
  H_i = H[K:]
  for hp in H_i:
    hp = int(hp)
    sum += hp
  print(sum)
else:
  print(0)

feneck = input().split()
H = input().split()
H_i = [int(h) for h in H]

N = int(feneck[0])
K = int(feneck[1])

list.sort(H_i, reverse=True)

if K < len(H_i):
  sum = 0
  H_i = H_i[K:]
  for hp in H_i:
    hp = int(hp)
    sum += hp
  print(sum)
else:
  print(0)

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 = sorted(h)
print(h)
h.reverse()

print(sum(h[k:]))

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

h = sorted(h)

h.reverse()

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):
n,k=map(int,input().split())
h=[0]*10**9
h=list(map(int,input().split()))
H=max(h)

for i in range(k):
  H[i]=0

mon=0
for i in range(n):
  mon+=h[i]
  
print(mon)

n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
if n<=k:
  print(0)
  exit()
  
for i in range(k):
  h[i]=0
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):
N,K = map(int,input().split())
H = map(int,input().split()).sort()

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

N,K = map(int,input().split())
H = [int(x) for x in input().split()]
H.sort()

if N >= K:
    print(sum(H[0: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):
N, K = map(int, input().split())
H = map(int, input().split())
H = H[:-K]
print(sum(H))

N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
if K != 0:
    H = H[:-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):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
if n<k:
    print(0)
    print(h)

else:
    a=h[:-k]
    ans=sum(a)
    print(h,ans)

n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
if n<k:
    print(0)

else:
    a=h[:-k]
    ans=sum(a)

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

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 = input().split(" ")
H = list(map(int, input().split()))
sorted_H = sort(H)
K = int(K)
print(sum(H[:-K]))

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

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

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

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

if K >= len(H):
	print(0)
elif: K == 0:
	print(sum(H))
else:
	print(sum(H[:-K]))

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

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

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

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

Verdicts: Runtime Error

Runtime Error

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):
import heapq

def heapsort(iterable):
    h = []
    for value in iterable:
        heapq.heappush(h, value)
    return [heapq.heappop(h) for i in range(len(h))]

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

heapsort(H)
# heapq.heapify(H)
# H.sort(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))


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

H.sort(reverse=True)

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


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

H.sorted(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        print(sum(H[K:]))


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

H.sort(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))


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

H.sorted(reverse=True)
ans=0

if K >= N:
    print(ans)
else:
    for i in range(K):
        ans += 1


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

H.sorted(reverse=True)

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


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

H.sort(reverse=True)

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


Verdicts: Runtime Error

Runtime Error

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())
b = list(map(int, input().split()))

b.sort(reverse=True)
ans = 0

while k > 0:
    if n < 0:
        break
    else:
        del b[:k]
        n -= k

if n == 0:
    print('0')
else:
    print(sum(b))

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

b.sort(reverse=True)
ans = 0

del b[:k]
n -= k

if n < 0:
    print('0')
else:
    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())
H=list(map(int,input().split()))
if N>K:
  H.sort()
  del H[N-K+1:]
  print(sum(H))
else:
  print(0)

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

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
import math
import sys


N, K = map(int, input().rstrip().split())

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

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

print(ans)


# coding utf-8
import math

N, K = map(int, input().rstrip().split())

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

if N > K:
    if K == 0:
        ans = sum(H)
    else:
        ans = sum(H[:-K])
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 = input().split();
n = int(n);
k = int(k);

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


yowa = H.sort(reverse=True)[k+1:];

ans = sum(yowa);

print(ans);

n ,k = input().split();
n = int(n);
k = int(k);

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


H.sort(reverse=True);
yowa = H[k:];

ans = sum(yowa);

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())
Hi = list(map(int,input().split()))
Hi.sort(reverse=True)
print(Hi)
del Hi[:K]
print(Hi)
min_count = sum(Hi)
print(min_count)

N, K = map(int,input().split())
Hi = list(map(int,input().split()))
Hi.sort(reverse=True)
del Hi[:K]
min_count = sum(Hi)
print(min_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 = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort()
for k in range(0, K-1):
    H[k] = 0
print(sum(H))

N, K = input().split()
N = int(N)
K = int(K)
H = input().split()
H = [int(h) for h in H]
H.sort(reverse = True)
# print(H)
I = K if K <= N else N
for i in range(0, I):
    H[i] = 0
# print(H)
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):
N,K=map(int,input().split())
H=sorted(list(map(int,input().split())))
print(H[:N-K])
if len(H) < K:
    print(0)
else:
    print(sum(H[N-K:]))


N,K=map(int,input().split())
H=sorted(list(map(int,input().split())))
if len(H) < K:
    print(0)
else:
    print(sum(H[: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, k = map(int, input().split())
# h = list(map(int, input().split()))
h = [i for i in range(n)]
h = sorted(h)
# print(h[:-1], h)
if k > len(h):
    print(0)
else:
    if k != 0:
        del h[-k:]
    print(sum(h))

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

h = sorted(h)
# print(h[:-1], h)
if k > len(h):
    print(0)
else:
    if k != 0:
        del 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())
a=list(map(int,input().split()))

if n<=k:
  print(k)
  
else:
  a=sorted(a)
  b=n-k
  ans=0
  for x in range(n-k):
    ans+=a[x]
    
  print(ans+k)

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

if n<=k:
  print(0)
  
else:
  a=sorted(a)
  b=n-k
  ans=0
  for x in range(n-k):
    ans+=a[x]
    
  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())
Monsters = list(map(int,input().split()))
Monsters = sorted(Monsters)

for i in range(min(K,N)):
    Monsters[i]=0
print(sum(Monsters))
    

N, K = map(int,input().split())
Monsters = list(map(int,input().split()))
Monsters.sort(reverse=True)

for i in range(min(K,N)):
    Monsters[i]=0
print(sum(Monsters))
    

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()))

if len(h) <= k:
	print(0)

else:
	h.sort(reverse = True)

	for i in range(0, k):
		h[i] = 0

	print(k)

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

if len(h) <= k:
	print(len(h))

else:
	h.sort(reverse = True)

	for i in range(0, k):
		h[i] = 0

	print(sum(h) + k)

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

if len(h) <= k:
	print(0)

else:
	h.sort(reverse = True)

	for i in range(0, k):
		h[i] = 0

	print(sum(h))

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 = list(map(int, input().split()))
list_h = sorted(list(map(int, input().split())), reverse=True)

ans = 0
for i in list_h:
    if k > 0:
        k = k - 1
        ans = ans + 1
    else:
        ans = ans + i
print(ans)

n, k = list(map(int, input().split()))
list_h = sorted(list(map(int, input().split())), reverse=True)

ans = 0
for n, i in enumerate(list_h):
    if k > 0:
        k = k - 1
        list_h[n] = 0
    else:
        break

ans = ans + sum(list_h)
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):
a,b = map(int, input().split())
box = list(map(int, input().split()))
box.sort()
ans = sum(box[b:])
print(ans)

a,b = map(int, input().split())
box = list(map(int, input().split()))
box.sort(reverse=True)
ans = sum(box[b:])
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=sorted(h,reverse=True)
if n>=k:
	for i in range(k):
		H[i]=0
print(sum(H))
else: 
	print(0)

n,k=map(int, input().split())
h=list(map(int,input().split()))
H=sorted(h,reverse=True)
if n>=k:
 for i in range(k):
  H[i]=0
 print(sum(H))
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):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

enemyHp.sort()
print(enemyHp)
resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0


for i in range(resultEnemyCount):
    countNormal += int(enemyHp[i])

print(countNormal)

N,K = input().split()
H = input().split()

if N < K:
    times = N
else:
    times = K

for i in range(int(times)):
    H.remove(max(H))

print(sum(H))

N,K = input().split()
H = input().split()

if N < K:
    times = N
else:
    times = K

for i in range(times):
    H.remove(max(H))

print(sum(H))

enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

intEnemyHp = [int(i) for i in enemyHp]
intEnemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0


    # print(0)

# else:
for i in range(resultEnemyCount):
    countNormal += intEnemyHp[i]
print(countNormal)

Verdicts: Wrong Answer

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()))
if n<=k:
  print(0)
else:
  h.sort()
  print(sum(h[:n-k])

n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:
  print(0)
else:
  h.sort()
  print(sum(h[:n-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 = sorted(list(map(int,input().split())))

H = H[:K-1]

print(sum(H))

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



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

for i in range(K):
  if len(H) == 0:
    break
  H.pop()

print(sum(H))

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):
l, k = map(int, input().split(" "))
if k >= l:
  print(0)
else:
  print(sorted(map(int, input().split(" ")))[:l-k])


l, k = map(int, input().split(" "))
if k >= l:
  print(0)
else:
  print(sum(sorted(map(int, input().split(" ")))[: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()))

H.sort(reverse=True)
for i in range(k):
  H[i] = 0
  print(H)

print(sum(H))

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

  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):
N, K = map(int, input().split())
H = list(map(int, input().split()))
if len(H) <= K:
  print(len(H))
else:
  print(K+sum(sorted(H)[:len(H)-K]))

N, K = map(int, input().split())
H = list(map(int, input().split()))
if len(H) <= K:
  print(0)
else:
  print(sum(sorted(H)[:len(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
input = sys.stdin.readline

N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]

if K >= N:
    print(0)
else:
    H.sort(reverse=True)
    for i in range(0, K):
        H.pop(i)

    print(sum(H))

import sys
input = sys.stdin.readline

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

if K >= N:
    print(0)
else:
    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 = [int(x) for x in input().split()]
H.sort()
Ans = 0
for x in (0,K):
    H.pop()
for x in range(0,N):
    Ans = H[x]+Ans
print(Ans)

N,K = map(int,input().split())
H = [int(x) for x in input().split()]
#print(H)
H.sort()
#print(H)
Ans = 0
for x in range(0,min(K,N)):
#    print(x)
    H.pop()
#print(H)
for x in H:
    Ans = x+Ans
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())
H = [int(h) for h in input().split()]
H = list(sorted(H, reverse = True))
print(H)
if len(H) <= K:
  print(0)
else:
  del H[0:K]
  print(sum(H))

N, K = map(int, input().split())
H = [int(h) for h in input().split()]
H = list(sorted(H, reverse = True))

if len(H) <= K:
  print(0)
else:
  del H[0: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())
lst = list(map(int, input().split()))
lst.sort(reverse=True)
ans = 0

if N <= K:
  print(N)
else:
  print(sum(lst[K:])+K)

N, K = map(int, input().split())
lst = list(map(int, input().split()))
lst.sort(reverse=True)
ans = 0

if N <= K:
  print(0)
else:
  print(sum(lst[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()))
H.sort()
ans = K
for i in range(K):
    H.pop()
ans += sum(H)

N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
ans = K
for i in range(K):
    H.pop()
ans += sum(H)
print(ans)

N,K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
ans = 0
for i in range(min(K,N)):
    H.pop()
ans += sum(H)
print(ans)

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):
n,k=map(int,input().split())
hp=list(map(int,input().split()))
hp.sort(reverse=True)
print(sum(hp[-k:]))

n,k=map(int,input().split())
hp=list(map(int,input().split()))
hp.sort(reverse=True)
print(sum(hp[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()))

h.sort(reverse=True)

cnt=0
for i in range(1,n):
  cnt += h[i]

print(cnt+1)

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):
# coding: utf-8
# Your code here!

n, k = map(int, input().split())
hs = list(map(int, input().split()))
hs.sort()
if (n <= k):
  print(0)
else:
  print(sum(hs[k:]))
  

n, k = map(int, input().split())
hs = list(map(int, input().split()))
hs.sort(reverse=True)
if (n <= k):
  print(0)
else:
  print(sum(hs[k:]))
  

Verdicts: Wrong Answer

Accepted