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

a.sort()

counter = 0
if K > len(a):
  counter = 0
else:
  print(a)
  for _ in range(K):
      a.pop(-1)
  counter = sum(a)
print(counter)

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

a.sort()

counter = 0
if K >= len(a):
  counter = 0
else:
  for _ in range(K):
      a.pop(-1)
  counter = sum(a)
print(counter)

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

n, k = list(map(int, input().rstrip().split()))
h = list(map(int, input().rstrip().split()))
h.sort()
print(sum(h[:max(0, 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):
inputs = input().split(" ")

monsters_num, special_moves = int(inputs[0]), int(inputs[1])

health_inp = input().split(" ")
print(health_inp)
monsters_health = [int(h) for h in health_inp]
print(monsters_health)
monsters_health.sort(reverse=True)
print(sum(monsters_health[special_moves:]))

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

h.sort()
if k:
    print(sum(h[:-k]))
else
    print(sum(h))

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

h.sort()

if k:
    print(sum(h[:-k]))
else:
    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):
print(~-(1<<len(bin(int(input()))[2:])))

#!/usr/bin/env python3
n, k, *h = map(int, open(0).read().split())
print(sum(sorted(h)[-k-1::-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 = (int(z) for z in input().split())
a = [int(z) for z in input().split()]
a.sort()
sm = 0
for i in range(k,n):
  sm += a[i]
print(sm)

n, k = (int(z) for z in input().split())
a = [int(z) for z in input().split()]
a.sort()
sm = 0
for i in range(n - k):
  sm += a[i]
print(sm)

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 math

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

if N <= K:
  print(0)
elif K == 0:
  print(sum(H))
else:
  H.sort()
  h = H[:-K]
  print(h)
  print(sum(h))


import math

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

if N <= K:
  print(0)
elif K == 0:
  print(sum(H))
else:
  H.sort()
  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())
hs = list(map(int,input().split()))

hs.sort()

print(sum(hs[:-3]))

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

hs.sort()

print(sum(hs[:len(hs)-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())
a=sorted(list(map(int,input().split())),reverse=True)
print(sum(a[k:-1]))


n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
print(sum(a[k:-1]))


n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)
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())
H = list(map(int, input().split()))
sH = sorted(H, reverse=True)
ans = sum(sH[k:n-1:])
print(ans)

H, n = map(int, input().split())
List = [[0 for i in range(4)] for j in range(n)]
for i in range(n):
    a, b = map(int, input().split())
    List[i][0] = b / a
    List[i][1] = b / H
    List[i][2] = a
    List[i][3] = b

def recal():
    for i in range(n):
        b = List[i][3]
        List[i][1] = b / H

sList = sorted(List)
MP = 0
k = 0
while H > 0:
    if sList[k][2] <= H:
        H -= sList[k][2]
        MP += sList[k][3]
        recal()
    else:
        if sList[k + 1][2] <= H:
            if sList[k][1] <= sList[k + 1][0]:
                H -= sList[k][2]
                MP += sList[k][3]
                recal()
                break
            else:
                H -= sList[k + 1][2]
                MP += sList[k + 1][3]
                recal()
                k += 1
        else:
            if sList[k][1] <= sList[k + 1][1]:
                H -= sList[k][2]
                MP += sList[k][3]
                recal()
                break
            else:
                H -= sList[k + 1][2]
                MP += sList[k + 1][3]
                recal()
                k += 1
print(MP)

n, k = map(int, input().split())
H = list(map(int, input().split()))
sH = sorted(H, reverse=True)
ans = sum(sH[k-1:n-1:])
print(ans)

n, k = map(int, input().split())
H = list(map(int, input().split()))
sH = sorted(H, reverse=True)
ans = sum(sH[k::])
print(ans)

Verdicts: Wrong Answer

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


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

K = min(N,K)


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

data.sort()

total = sum( data[0:N-K] )

print(data)
print(total)

    

import math


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

K = min(N,K)


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

data.sort()

total = sum( data[0:N-K] )


print(total)


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

ls = sorted(ls)

if len(ls)<3:
  print(0)
else:
  print(sum(ls[:-2]))

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

ls = sorted(ls)


if len(ls)<k+1:
  print(0)
else:
  print(sum(ls[:-k]) if k>0 else sum(ls))



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

import math
def d(N): 
    return int(math.log10(N)) +1


N_min =0
N_max =10**9
while 1<(N_max - N_min):
    N=(N_max + N_min)//2
    if A*N +B*d(N) >X:
        N_max = N
    else:
        N_min =N
if A * N_max + B * d(N_max) <X:
    print(N_max)
else:
    print(N_min)


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



nokori_kaisu = 0
H_sorted = sorted(H)
if N <= K:
    nokori_kaisu = 0
else:
    nokori_hissatuwaza = N -K
    
    nokori_kaisu = sum( H_sorted[:nokori_hissatuwaza] ) 

print(nokori_kaisu)


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())
arr = [int(j) for j in input().split()]
if k>= n:
	print(0)
else:
	arr.sort()
	print(sum(arr[k:]))

n, k = map(int, input().split())
arr = [int(j) for j in input().split()]
if k>= n:
	print(0)
else:
	arr.sort(reverse=True)
	print(sum(arr[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()))



# two actions

# special: make vitality 0. Fenek can use K times of specials.

# print(H)

if N <= K:
    print(0)
    exit()


H.sort(reverse=True)
# print(H)


r_H = H[K:]
# print(r_H)
print(sum(r_H))

sum_H = 0
for hp in r_H:
    sum_H += hp
print(sum_H)

# print(type(10**9))
# print(type(2*10**14))

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



# two actions

# special: make vitality 0. Fenek can use K times of specials.

H.sort(reverse=True)

if N <= K:
    print(0)
    exit()


r_H = H[K:]


sum_H = 0
for hp in r_H:
    sum_H += hp

print(sum_H)
print(10**9)
print(2*10**14)

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



# two actions

# special: make vitality 0. Fenek can use K times of specials.

# print(H)

if N <= K:
    print(0)
    exit()


H.sort(reverse=True)
# print(H)


r_H = H[K:]
# print(r_H)
# print(sum(r_H))

sum_H = 0
for hp in r_H:
    sum_H += hp
print(sum_H)

# print(type(10**9))
# print(type(2*10**14))

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):
monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    monster_hp.pop(-1)

for hp in monster_hp:
    attack_count += hp

print(hp)

monster, skill = map(int,input().split())

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

sorted_monster_hp = monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    sorted_monster_hp.pop(-1)

for hp in sorted_monster_hp:
    attack_count += hp

print(hp)

monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    print(monster_hp)

for hp in monster_hp:
    attack_count += hp

print(attack_count)

monster, skill = map(int,input().split())

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

monster_hp.sort()

attack_count = 0

while(skill>0):
    skill -= 1
    if len(monster_hp) > 0:    
        monster_hp.pop(-1)
    

for hp in monster_hp:
    attack_count += hp

print(attack_count)

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 = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
h.sort(reverse=True)
  
if(len(h) <= k):
	print("0")
else:
	print(sum(h,k))

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

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

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


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

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

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

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

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

Verdicts: Runtime Error

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

if len(b) <= a[1]:
    print("0")
elif a[1]==0:
    print(sum(b))
else:
    del b[a[0]-1]
    b.sort(reverse=True)
    print(sum(b[(a[1]-1):len(b)]))
    print(b[a[1]:])


a = list(map(int,input().split()))
b = list(map(int,input().split()))

b.sort(reverse=True)
for i in  range(a[1]):
        del b[0]
    print(sum(b))

a = list(map(int,input().split()))
b = list(map(int,input().split()))

if len(b) <= a[1]:
    print("0")
elif a[1]==0:
    print(sum(b))
else:
    b.sort(reverse=True)
    print(sum(b[a[1]:]))

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

H=sorted(H, reverse=True)
print(H)
print(sum(H[K:]))

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

H=sorted(H, 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 numpy
N,K = map(int,input().split())
H = list(map(int,input().split()))

H = numpy.sort(H)
#print(H)

for i in range(K):
  H.remove(H[N-1-i])

print(sum(H))

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

H = numpy.sort(H)
sum = 0
#print(H)
if N-K > 0:
  for i in range(N-K):
    sum = sum + H[i]
else:
    sum = 0
    
print(sum)

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


# coding: utf-8
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
if n <= k:
    print(n)
else:
    print(sum(h[0: n - k]) + k)


# coding: utf-8
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
if n <= k:
    print(0)
else:
    print(sum(h[0: n - k]))


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):
n,k=map(int,input().split())
mon=list(map(int,input().split()))
mon.sort(reverse=true)
for i in range(k):
  mon.pop(0)
print(sum(mon))
  

n,k=map(int,input().split())
mon=list(map(int,input().split()))
mon.sort(reverse=True)

print(sum(mon[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):
h = int(input())
ans = 0
c = 0
while h >0:
    ans += 2**c
    h //= 2
    c+= 1
print(ans)

n,k = map(int,input().split())
h= list(map(int,input().split()))
sorted(h)
print(sum(h[:-k+1]))

h = int
(input())
ans = 0
c = 0
while h >0:
    ans += 2**c
    h //= 2
    c+= 1
print(ans)

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

n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse=True)
print(sum(h[k:]))

Verdicts: Runtime Error

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

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


print(sum(H[K:])+min(K,N))
    
    

N,K=map(int,input().split())
print(sum(sorted(map(int,input().split()),reverse=True)[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 = input().split()
m = [int(x) for x in input().split()]
m.sort()
for i in range(k):
  if len(m) == 0:
    break
  m.pop(len(m))
print(sum(m))

n,k = [int(x) for x in input().split()]
m = [int(x) for x in input().split()]
m.sort()
if n<k:
  k = n
print(sum(m[0: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):
import heapq

n, k = map(int, input().split())
h = [-1 * int(i) for i in input().split()]
heapq.heapify(h)

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

for i in range(k):
  heapq.heappop(h)

print(sum(h))

import heapq

n, k = map(int, input().split())
h = [-1 * int(i) for i in input().split()]
heapq.heapify(h)

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

for i in range(k):
    heapq.heappop(h)

print(-1*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):
i = list(map(int, input().split()))
j= list(map(int, input().split()))
x=sorted(j, reverse=True)
z=0

if i[1]>=len(j):
  print(0)
else:
  for a in range(i[0],len(x)):
    z+=x[a]
  print(z)

i = list(map(int, input().split()))
j= list(map(int, input().split()))
x=sorted(j, reverse=True)
z=0
 
if i[1]>=len(j):
  print(0)
else:
  for a in range(i[1],len(x)):
    z+=x[a]
  print(z)

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()
cnt = max(N,K)
ans = 0
for i in range(N-cnt):
    ans+=H[i]
print(ans)

N, K = map(int,input().split())
H = list(map(int,input().split()))
H.sort()
cnt = min(N,K)
ans = 0
for i in range(N-cnt):
    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()))

if N <= K:
  print(0)
elif K == 0:
  print(sum(H))
else:
  H.sort()
  H_hissatsued = H[:-K]
  print(H_hissatsued)
  print(sum(H_hissatsued))

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

if N <= K:
  print(0)
elif K == 0:
  print(sum(H))
else:
  H.sort()
  H_hissatsued = H[:-K]
  #print(H_hissatsued)
  print(sum(H_hissatsued))

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(n)
print(k)
print(h)

s = 0

i = 0
while i < len(h)-k:
  s += h[i]
  i += 1

print(s)

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

# print(n)
# print(k)
# print(h)

s = 0

i = 0
while i < n-k:
  s += h[i]
  i += 1

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=[int(x) for x in input().split()]
arr=[int(x) for x in input().split()]
s=0
if(n>k):
	for i in range(n-k):
  		s+=arr[i]
    print(s)
else:
  print(0)

  

n,k=[int(x) for x in input().split()]
arr=[int(x) for x in input().split()]
s=0
arr.sort()
if(n>k):
    for i in range(n-k):
        s+=arr[i]
    print(s)
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 = list(map(int, input().split()))
if N<=K:
    print(0)
else:
    H.sort()
    print(sum(H)-sum(H[N-1-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 = list(map(int,input().split()))
H.sort()
s = 0
for i in range(K):
  s += H[i]
print(s+K) 


N,K= map(int,input().split())
H = list(map(int,input().split()))
H = sort(H)
s = 0
for i in range(N-K):
  s += H[i]
print(s+K)
  


N,K= map(int,input().split())
H = list(map(int,input().split()))
H.sort()
s = 0
for i in range(N-K):
  s += H[i]
print(s) 


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()))
a = sorted(a,reverse=true)
for i in range(min(n,k)):
  pop(0)
print(sum(a))

n,k = map(int,input().split())
a = list(map(int,input().split()))
a = sorted(a,reverse=True)
del a[:min(n,k)]
print(sum(a))

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 K >= N:
  print(0)
 
elif K == 0:
  print(sum(H))

else:
  H.sort
  print(sum(H[K-1:]))

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

if K >= N:
  print(0)
 
elif K == 0:
  print(sum(H))

else:
  H.sort
  print(sum(H[K+1:N-1]))

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

if K >= N:
  print(0)
 
elif K == 0:
  print(sum(H))

else:
  newH = sorted(H, reverse=True)
  print(sum(newH[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())

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

H.sort(reverse=True)

print(sum(H[k+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):

n,k = map(int,input().split())
tairyoku = list(map(int,input().split()))
tairyoku.sort(reverse=True)

if k == 0:
    print(sum(tairyoku))
    
else:
    del tairyoku[:k]
    print(tairyoku)
    print(sum(tairyoku))


n,k = map(int,input().split())
tairyoku = list(map(int,input().split()))
tairyoku.sort(reverse=True)

if k == 0:
    print(sum(tairyoku))
    
else:
    del tairyoku[:k]
    print(sum(tairyoku))


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

print(sum(h[-k:]) if k!=1 else k)


n, k = map(int, input().split())
h = sorted(map(int, input().split()))[::-1]

print(sum(h[k:]) if k!=1 else k)


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

print(sum(h[-k:]) if k != 1 else k)


import sys
input = sys.stdin.readline

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

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

Verdicts: Wrong Answer

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):
import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
d=0
c.sort()
e=-1
f=0
for i in range(a):
  d+=c[i]

for i in range(b):
   if b>0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
    if d<0:
      print(f)
      sys.exit()
while 1:
  d-=c[e]
  f+=1
  if d<0:
    print(f)
  else:
    pass

import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
if a<=b:
  print(0)

else:
  f=0
  d=0

  c.sort()
  e=-1
  f=0
  for i in range(a):
    d+=c[i]
  

  for i in range(b):
    if b>=0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
      if d<=0:
        print(f)
        sys.exit()
      
  
  f+=c[e]
  f+=c[e-1]

  print(f)



import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
if a<=b:
  print(0)

else:
  f=0
  d=0

  c.sort()
  e=-1
  f=0
  for i in range(a):
    d+=c[i]
  

  for i in range(b):
    if b>0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
      if d<=0:
        print(f)
        sys.exit()
      
for i in range(a+e+1):
  f+=c[i]

print(f)



import sys
a,b=map(int,input().split())
c=list(map(int,input().split()))
if a<=b:
  print(0)
  sys.exit()

else:
  f=0
  d=0

  c.sort()
  e=-1
  f=0
  for i in range(a):
    d+=c[i]
  

  for i in range(b):
    if b>0:
      b-=1
      f+=1
      
      d-=c[e]
      e-=1
      if d<=0:
        print(f)
        sys.exit()
      
for i in range(a+e+1):
  f+=c[i]

print(f)



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

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


Verdicts: Runtime Error

Runtime Error

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):
N, K = map(int, input().split())
Hs = sorted(list(map(int, input().split())))
while K > 0:
  Hs.pop()
print(sum(Hs))

N, K = map(int, input().split())
Hs = sorted(list(map(int, input().split())))
if K >= N:
  print("0")
else:
  while K > 0:
    Hs.pop()
    K -= 1
  print(sum(Hs))

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

n,k=map(int,input().split())
if n==0:
  print(0)
else:
  c=sorted(list(map(int,input().split())))
  if k>=n:
    print(0)
  else:
    print(sum(c[: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):
l=[int(x) for x in input().rstrip().split()]
l.sort(reverse = True)

ans=0

del l[0:a]
ans = a
print(sum(l))

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

H.sort(reverse=True)
k=0
if N<=K:
  K=N
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):
3 0
1000000000 1000000000 1000000000

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


Verdicts: Runtime Error

Accepted