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

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

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())
List=sorted(list(map(int,input().split())))
a = 0
for i in range(N - k):
  a = a + List[i]
print(a)

N, K=map(int, input().split())
List=sorted(list(map(int,input().split())))
a = 0
for i in range(N - K):
  a = a + List[i]
print(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())
a=sorted(list(map(int,input().split())),reverse=True)[k-1:]
print(sum(a))

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

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()
h=[::-1]
if k!=0:
  for i in range(k):
    h[i]=0

  
print(sum(h))


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

if k>=n:
  print(0)
  
elif k!=0:
  for i in range(k):
    h[i]=0
  print(sum(h))

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


H, K = int(input().split())
array = list(map(int, input().split()))
A = sorted(array, reverse=True)
del A[0:K-1]
print(sum(A))

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

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())
Hlist = list(map(int, input().split()))
Hlist.sort(reverse=True)
'''
print(Hlist)
'''
if K == 0:
  print(sum(Hlist))
elif K == 1:
  del Hlist[0]
  print(Hlist)
  print(sum(Hlist))
else:
  del Hlist[0:K-1]
  print(Hlist)
  print(sum(Hlist))

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


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 = input().rstrip()
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

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

N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

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

N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

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

N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N, K = map(int, input().split(' '))
H = sorted(map(int, input().split(' ')))
if(K >= N):
    print(0)
    exit(0)
for j in range(K):
    H[K - j - 1] = 0
print(sum(H))

N, K = map(int, input().split(' '))
H = sorted(map(int, input().split(' ')))
print(H)
if(K >= N):
    print(0)
    exit(0)
for j in range(K):
    H[N - j - 1] = 0
print(sum(H))

N, K = map(int, input().split(' '))
H = sorted(map(int, input().split(' ')))
if(K >= N):
    print(0)
    exit(0)
for j in range(K):
    H[N - j - 1] = 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(' ')))
h_arr = list(map(int, input().split(' '))).sorted(reverse=True)

if n <= k:
  print('0')
else:
  print(sum(h_arr[k:]))

n, k = list(map(int, input().split(' ')))
h_arr = sorted(list(map(int, input().split(' '))),reverse=True)
 
if n <= k:
  print('0')
else:
  print(sum(h_arr[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([int(x) for x in input().split()], inverse=True)
if K >= len(H):
    print('0')
else:
    print(sum(H[K:]))

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

n,k=(int(i) for i in input().split())
h=[0 for i in range(k)]
p=0
for i in input().split():
  p+=int(i)
  try:
      if h[0]<i:
        h[0]=int(i)
        h.sort()
  except IndexError:
    continue
print(p-sum(h))

n,k=(int(i) for i in input().split())
h=[]
for i in input().split():
  h.append(int(i))
h.sort()
for i in range(k):
  h.pop(-1)
print(sum(h)+k)

n,k=(int(i) for i in input().split())
h=[]
for i in input().split():
  h.append(int(i))
h.sort()
if k!=0:
	for i in range(min(n,k)):
 	  h.pop(-1)
print(sum(h))


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):
a=input().split()
(n,m)=map(int,a)
b=input().split()
b1=list(map(int,b))
b1=sorted(b1)
for i in range(m):
    b1[i]=0
    if i==len(b1)-1:
        break

print(sum(b1))

a=input().split()
(n,m)=map(int,a)
b=input().split()
b1=list(map(int,b))
b1=sorted(b1)
for i in range(m):
    b1[len(b)-1-i]=0
    if i==len(b1)-1:
        break

print(sum(b1))

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()))
A.sort()
S = 0
for i in range(0, K):
  if not A.empty():
    A.pop_back()
print(sum(A))

N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
S = 0
for i in range(0, K):
    if len(A) > 0:
        A.pop(-1)
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())
if n <= k:
  print(0)
  return
h = list(map(int, input().split())).sort()
print(sum(h[:-k]))

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

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

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

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 = sorted(h)
  print(sum(h[:n-k]))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
n, k = map(int,input().split())
h = list(map(int,input().split()))
hsort = sorted(h)
ans = sum(hsort[k-n:])
print(ans)

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

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

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()
for i in range(k):
    h[i] = 0
print(sum(h))

n,k = map(int,input().split())
h = list(map(int,input().split()))
h.sort(reverse = True)
for i in range(min(n,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()))
h.sort(reverse=True)
del h[5]
print(sum(h))

n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort(reverse=True)
del 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()))

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

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

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

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

Verdicts: Runtime Error

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

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

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

h = input().split()
h.sort(reverse=True)

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

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(sum(sorted(h)[:n-k+1]))

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

EnemyCount, slayeCount = map(int, input().split())
enemyHealths = list(map(int, input().split(" "))).sort()

if EnemyCount < slayeCount:
    slayeCount = EnemyCount

for _ in range(slayeCount):
    del enemyHealths[-1]

print(sum(enemyHealths))

import math

EnemyCount, slayeCount = map(int, input().split())
enemyHealths = list(map(int, input().split(" ")))
enemyHealths.sort()

if EnemyCount < slayeCount:
    slayeCount = EnemyCount

for _ in range(slayeCount):
    del enemyHealths[-1]

print(sum(enemyHealths))


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,n = input().split()
w = input().split()

for i in range(0,int(n)):
    h = int(h) - int(w[i])

if(h<=0):
    print("Yes")
else:
    print("No")

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

if(int(n)<=int(k)):
    print(0)
elif(int(k)==0):
    print(sum(mon))
else:    
    mon.sort(reverse=True)
    for i in range(0,int(k)):
        mon[i] = 0
        
    print(sum(mon))

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):
x = [int(i) for i in input().split(" ")]
s = x[1]
m = [int(i) for i in input().split(" ")]
if s == 0:
  print(sum(m))
else:
  m = sorted(m)[0:-s:1]
  print(m)

x = [int(i) for i in input().split(" ")]
s = x[1]
m = [int(i) for i in input().split(" ")]
if s == 0:
  print(sum(m))
else:
  m = sorted(m)[0:-s:1]
  print(sum(m))

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

Nlife = sorted(life, reverse=True)


if K >= 1:
  del Nlife[:K-1]
  

answer = sum(Nlife)

print(answer)

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

Nlife = sorted(life)


if K >= 1:
  del Nlife[:K-1]
  

answer = sum(Nlife)

print(answer)

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

Nlife = sorted(life, reverse=True)


if K >= 1:
  del Nlife[:K]
  

answer = sum(Nlife)

print(answer)


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

del h[n::]
h.sort()
if k != 0:
  del h[-k:]
print(h)
print(sum(h))

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

del h[n::]
h.sort()
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):
from sys import stdin


def main(inp1, inp2):
    n, k = [int(i) for i in inp1.split(sep=' ')]
    h_list = sorted([int(i) for i in inp2.split(sep=' ')])

    print(h_list)
    num_enemy = n
    enable_special = k

    if enable_special >= num_enemy:
        return 0
    elif enable_special == 0:
        return sum(h_list)
    else:
        return sum(h_list[:-enable_special])


if __name__ == '__main__':
    input1 = stdin.readline().rstrip()
    input2 = stdin.readline().rstrip()
    ret = main(input1, input2)
    print(ret)

from sys import stdin


def main(inp1, inp2):
    n, k = [int(i) for i in inp1.split(sep=' ')]
    h_list = sorted([int(i) for i in inp2.split(sep=' ')])

    num_enemy = n
    enable_special = k

    if enable_special >= num_enemy:
        return 0
    elif enable_special == 0:
        return sum(h_list)
    else:
        return sum(h_list[:-enable_special])


if __name__ == '__main__':
    input1 = stdin.readline().rstrip()
    input2 = stdin.readline().rstrip()
    ret = main(input1, input2)
    print(ret)

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 k == 0:
    print(sum(H))
    exit()

H.sort(reverse=True)
del H[:k + 1]
print(sum(H))

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

if k == 0:
    print(sum(H))
    exit()

H.sort(reverse=True)
del H[:k + 1]
if not H:
    print(0)
else :
    print(sum(H))

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

if k == 0:
    print(sum(H))
    exit()

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

H.sort(reverse=True)
del H[:k]
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 = map(int, input().split())
h = list(map(int, input().split()))
h = h.sort()

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

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

if k >= n:
  print(0)
  
else:
  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()))
if N <= K:
  print(0)
elif K == 0:
  print(sum(H))
else:
  H = sort(H)
  print(sum(H[:-K]))

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

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 = sorted(H)
  print(sum(H[:-K]))


Verdicts: Runtime Error

Runtime Error

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

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

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

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

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

sorted_H = sorted(H)
num = np.maximum(0, N-K)
answer = sum(sorted_H[:num])
print(answer)

import numpy as np
N, K = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]

sorted_H = sorted(H)
num = np.maximum(0, N-K)
answer = sum(sorted_H[:num])
print(answer)

Verdicts: Runtime Error

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
h = int(input())

res = 0
i = 1

while h > 0:
  h = h//2
  res = res + i
  i*2
print(res)

h = int(input())

res = 0
i = 1
while h > 0:
  h = h//2
  res = res + i
  i *= 2
print(res)



Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
import math
h=int(input())
k=math.ceil(math.log2(h))
print(2**k-1)

  

import math
h=int(input())
k=math.ceil(math.log2(h))
if k==math.log2(h):
  print(2**(k+1)-1)
else:
  print(2**k-1)

Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

h = ii()
count = 0
while h >= 2:
    h = (h+1)//2
    count += 1
#print(count)
if count == 0:
    print(1)
else:
    print(2**(count)-1)


def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

h = ii()
count = 0
ans = 1
while h >= 2:
    h = h//2
    ans += 2*count
    count += 1
#print(ans,count)
if count == 0:
    print(1)
else:
    print(2**(count+1)-1)


Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
H = int(input())
s = 1
while H!=0:
    H = divmod(H, 2)[0]
    s *= 2
s = s / 2
print(int(s + p))


H = int(input())
s = 1
while H!=0:
    H = divmod(H, 2)[0]
    s *= 2

print(int(s / 2))


H = int(input())
s = 1
while H!=0:
    H = divmod(H, 2)[0]
    s *= 2
s = s / 2
p = s - 1
print(int(s + p))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
import math
h = int(input())
k = (math.log2(h))
print((2**(k+1)-1))

import math
h = int(input())
k = int(math.log2(h))
print((2**(k+1)-1))

Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
import math
a = []
b = []
toki = []
h, n = map(int, input().split())
for i in range(n):
  ai, bi =  map(float, input().split())
  toki.append((ai, bi))

def yeah(hp, toki):
  mp = 0
  dps = 0
  kou = 0
  for ai, bi in toki:
    t = ai
    if (hp - ai) <= 0:
      t = hp
    dps2 = float(t/bi)
    if dps <= dps2:
      dps = dps2
      mp = bi
      kou = t
  return (hp-kou, mp)
mp = 0
zan = h
while True:
  zan, mp2 = yeah(zan, toki)
  mp += mp2
  if zan <=0:
    break
print(int(mp))
  

import math 
h = int(input())
ans = 0
t = int(math.log2(h)+1)

for i in range(t):
  ans += 2**i
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

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

x = []
y = []

for i in range(n):
    a,b = map(int,input().split())
    x.append(a)
    y.append(b)

def knapsack(N,W,weight,value):
  inf=float("inf")
  dp=[[inf for i in range(W+1)] for j in range(N+1)]
  for i in range(W+1): dp[0][i]=inf

  for i in range(N):
    for w in range(W+1):
        m = dp[i][w]
        p = value[i]
        q = weight[i]
        while w >= q:
            if w - q >= 0:
                m=min(dp[i][w-q]+p,m)
            p += value[i]
            q += weight[i]
        m=min(dp[i][w-q]+p,m,p)
        dp[i+1][w] = m
  return dp[N][W]

k = knapsack(n,h,x,y)
print(k)

h = int(input())

count = 1
ans = 0

while h != 0:
    ans += count
    h = h//2
    count *=2

print(ans)

Verdicts: Runtime Error

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
import math
print(2**int(math.log2(int(input())))-1)


2**log2(int(input().split()[0]))-1



print(2**log2(int(input()))-1)


import math
print(2**int(math.log2(int(input()))+1)-1)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
import math
H = int(input())

count = 0
count = int(math.log2(H))

total = 0
total = (1 - (2**(count + 1)))/(1 - 2)
print(total)


import math
H = int(input())

count = 0
count = int(math.log2(H))

total = 0
total = int((1 - (2**(count + 1)))/(1 - 2))
print(total)


Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
H = int(input())

cnt = 0

while True:
    H //= 2
    cnt += 1

    if H == 0:
        break

print(cnt)
print(2**cnt-1)



H = int(input())

cnt = 0

while True:
    H //= 2
    cnt += 1

    if H == 0:
        break

print(2**cnt-1)



Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
H=int(input())
A=1
if H==1:
    print(1)
else:
    while H>=A:
        A*=2

H=int(input())
A=1
if H==1:
    print(1)
else:
    while H>=A:
        A*=2
    print(A-1)
       

Verdicts: Wrong Answer

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
def a(x):
    if x == 1: return 1
    if x > 1: return a((x + 1) // 2)) * 2 + 1

print(a(int(input())))


def a(x):
    if x == 1: return 1
    if x > 1: return a((a(x // 2)) * 2 + 1

print(a(int(input())))


def a(x):
    if x == 1: return 1
    if x > 1: return a(x // 2) * 2 + 1

print(a(int(input())))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Caracal is fighting with a monster.  The _health_ of the monster is H.  Caracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:    * If the monster's health is 1, it drops to 0.   * If the monster's health, X, is greater than 1, that monster disappears. Then, two new monsters appear, each with the health of \lfloor X/2 \rfloor.  (\lfloor r \rfloor denotes the greatest integer not exceeding r.)  Caracal wins when the healths of all existing monsters become 0 or below.  Find the minimum number of attacks Caracal needs to make before winning.

Submission attempts (in order):
import bisect

H=int(input())
A=[2**x for x in range(51)]
if H%4==0:
  H+=1
index=bisect.bisect_left(A,H)
print(sum(A[:index]))

import bisect

H=int(input())
A=[2**x for x in range(51)]
index=bisect.bisect_right(A,H) 
print(sum(A[:index]))

Verdicts: Wrong Answer

Accepted