ZhenlongDai/ACPR huggingface dataset:
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))


H,K=input2()
h=input_array()

sorted_h=sorted(h)
if len(sorted_h)<1:
	print(0)
else:
	print(sum(sorted_h[:-K]))

Failing test case input:
3 0
0100000000 1000000001 1110000000

Expected output:
2210000001


Actual output:
0


Fixed submission (verdict: Accepted):

def input1():
	return int(input())


def input2():
	return map(int,input().split())


def input_array():
	return list(map(int,input().split()))


H,K=input2()
h=input_array()

if K>=H:
	print(0)
elif K<=0:
	print(sum(h))
else:
	sorted_h=sorted(h)
	print(sum(sorted_h[:-K]))

Problem: p02785
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k,*hh = map(int, open(0).read().split())

hh.sort()

print(sum(hh[:-k]))

Failing test case input:
3 0
0000000000 1100000000 0110000000

Expected output:
1210000000


Actual output:
0


Fixed submission (verdict: Accepted):
n,k,*hh = map(int, open(0).read().split())

hh.sort(reverse=True)

print(sum(hh[k:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = sorted(a)
if n <= k:
  print(0)
else:
  c = 0
  t = 0
  while t < n-k:
    c += a[t]
    t += 1
  print(c)

Failing test case input:
8 1
4 9 9 0 6 4 16 6

Expected output:
38


Actual output:
48


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = sorted(a)
if n <= k:
  print(0)
else:
  c = 0
  t = 0
  while t < n-k:
    c += b[t]
    t += 1
  print(c)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = input().split(" ")
H = list(map(int, input().split()))
H.sort()
K = int(K)
print(sum(H[:-K]))

Failing test case input:
3 0
0000000001 0100010000 0110000000

Expected output:
210010001


Actual output:
0


Fixed submission (verdict: Accepted):
N, K = input().split(" ")
H = list(map(int, input().split()))
H.sort()
K = int(K)

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

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

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

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

print(ans)


Failing test case input:
3 0
1000000000 1000000000 1000001000

Expected output:
3000001000


Actual output:
0


Fixed submission (verdict: Accepted):

import math

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

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

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

print(ans)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b=map(int,input().split())
l=list(map(int,input().split()))
if a<b:
  print(0)
elif a>b:
  l.sort(reverse=True)
  n=l[b:]
  s=sum(n)
  print(s)

Failing test case input:
8 8
7 9 3 2 3 8 4 6

Expected output:
0


Actual output:

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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))

Failing test case input:
3 1
4 1 6

Expected output:
5


Actual output:
12


Fixed submission (verdict: Accepted):
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:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input().split(" ")
n = int(x[0])
k = int(x[1])
h = list(map(int,input().split(" ")))

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

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

Failing test case input:
8 1
4 9 9 2 6 4 5 12

Expected output:
39


Actual output:
[12, 9, 9, 6, 5, 4, 4, 2]
39


Fixed submission (verdict: Accepted):
x = input().split(" ")
n = int(x[0])
k = int(x[1])
h = list(map(int,input().split(" ")))

h.sort(reverse=True)

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

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H,N=map(int, input().split())
l=list(map(int, input().split())) 

import math




import sys
if N>=len(l):
    print(l)
    sys.exit()

    
sort_l=sorted(l)
delete_l=sort_l[:len(l)-N]
score=0
for i in delete_l:
    score+=(math.ceil(i/H))
print(score)


Failing test case input:
3 0
1100000000 1000000000 1110000000

Expected output:
3210000000


Actual output:
1070000001


Fixed submission (verdict: Accepted):
H,N=map(int, input().split())
l=list(map(int, input().split())) 

import math




import sys
if N>=len(l):
    print(0)
    sys.exit()

    
sort_l=sorted(l)
delete_l=sort_l[:len(l)-N]
print(sum(delete_l))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import deque

h, k, *a = map(int, open(0).read().split())
if h <= k:
    print(k)
    exit()

a.sort()
q = deque(a)

[q.pop() for _ in range(k)]
print(q)
print(sum(q))


Failing test case input:
3 0
0000000100 0100000000 0110000000

Expected output:
210000100


Actual output:
deque([100, 100000000, 110000000])
210000100


Fixed submission (verdict: Accepted):
from collections import deque




h, k, *a = map(int, open(0).read().split())
k = min(h,k)

a.sort()
for _ in range(k):
    a.pop()

print(sum(a))
Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
s = list(map(int, input().split()))

if k > len(s):
    k = len(s)
for i in s:
    for j in range(1, k+1):
        s[s.index(max(s))]=0
print(sum(s))


Failing test case input:
8 2
7 6 2 1 0 23 0 5

Expected output:
14


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
s = list(map(int, input().split()))
if k > len(s):
    k = len(s)
s = sorted(s, reverse=True)

print(sum(s[k:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())),reverse=True)[k-1:]
print(sum(a))

Failing test case input:
8 2
7 2 2 1 0 23 0 6

Expected output:
11


Actual output:
18


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
H = list(map(int, input().split()))
if K != 0:
    H = H[:-K]
print(sum(H))


Failing test case input:
8 1
4 9 9 2 3 4 1 7

Expected output:
30


Actual output:
32


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
if K != 0:
    H = H[:-K]
print(sum(H))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

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


Failing test case input:
8 2
7 2 2 1 0 23 0 5

Expected output:
10


Actual output:
35


Fixed submission (verdict: Accepted):
import math

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

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int,input().split())
H = list(map(int, input().split()))

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

Failing test case input:
3 0
0000000001 0100010000 0110000000

Expected output:
210010001


Actual output:
0


Fixed submission (verdict: Accepted):
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:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
import sys


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

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

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

print(ans)


Failing test case input:
3 0
1110000000 1000000000 0110000100

Expected output:
2220000100


Actual output:
[]
2220000100


Fixed submission (verdict: Accepted):

import math

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

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

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

print(ans)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
feneck = input().split()
H = input().split()
H_i = [int(h) for h in H]

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

list.sort(H_i, reverse=True)

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

Failing test case input:
8 2
7 2 3 1 0 23 10 6

Expected output:
19


Actual output:
43


Fixed submission (verdict: Accepted):
feneck = input().split()
H = input().split()
H_i = [int(h) for h in H]

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

list.sort(H_i, reverse=True)

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



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

Failing test case input:
8 2
4 2 3 1 0 23 10 6

Expected output:
16


Actual output:
48


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())

hp=[int(x) for x in input().split()]
hp.sort()
re=sum(hp[:n-k])
print(re)


Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
hp=list(map(int,input().split()))
hp.sort(reverse=True)
print(sum(hp[k:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split(' '))
nums = list(map(int, input().split(' ')))
nums.sort(reverse=True)
if k >= n:
  print(0)
else:
  if k > 0:
    nums = nums[:k]
  print(sum(nums))

Failing test case input:
8 2
7 2 3 1 0 23 10 6

Expected output:
19


Actual output:
33


Fixed submission (verdict: Accepted):
n, k = map(int, input().split(' '))
nums = list(map(int, input().split(' ')))
nums.sort(reverse=True)
if k >= n:
  print(0)
else:
  if k > 0:
    del nums[:k]
  print(sum(nums))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
H=list(map(int,input().split()))

if N>K:
  for count in range(K):
    H.remove(max(H))
    print(sum(H))
else:
  print(0)

Failing test case input:
8 2
7 7 3 2 3 14 7 9

Expected output:
29


Actual output:
38
29


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
H=list(map(int,input().split()))
if K>=N :
  print(0)
elif K==0 :
  sum(H)
else :
  H.sort()
  print(sum(H[:N-K]))

Failing test case input:
3 0
0000000000 1000000100 1110000000

Expected output:
2110000100


Actual output:

Fixed submission (verdict: Accepted):
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[:N-K]))
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = [int(i) for i in input().split(' ')]
H = list(reversed([int(i) for i in input().split(' ')]))
print(sum(H[K:]))


Failing test case input:
3 1
0000000000 1100000000 0110000000

Expected output:
110000000


Actual output:
1100000000


Fixed submission (verdict: Accepted):
N, K = [int(i) for i in input().split(' ')]
H = sorted([int(i) for i in input().split(' ')], reverse=True)
print(sum(H[K:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
h=list(map(int,input().split()))

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

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

Failing test case input:
3 0
1000000000 1000010000 1010010000

Expected output:
3010020000


Actual output:
0


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
h=list(map(int,input().split()))

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

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
h = list(map(int,input().split()))

del h[n::]
h.sort()
del h[-k:]
print(sum(h))

Failing test case input:
3 0
0100000000 1000000001 1110000000

Expected output:
2210000001


Actual output:
0


Fixed submission (verdict: Accepted):
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))

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()

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

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h,n = map(int,input().split())
g = input().split()
G = sorted([int(j) for j in g])
del G[-n::]
print(sum(G))

Failing test case input:
3 0
0000000000 1000000100 1110000000

Expected output:
2110000100


Actual output:
0


Fixed submission (verdict: Accepted):
h,n = map(int,input().split())
g = input().split()
G = sorted([int(j) for j in g])
if n != 0:
    del G[-n::]
print(sum(G))

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = list(map(int,input().split()))
b = list(map(int,input().split()))

b.sort(reverse=True)

if len(b) <= a[1]:
    print("0")
else :
    print(sum(b[:a[1]]))


Failing test case input:
8 2
7 6 2 1 0 23 0 5

Expected output:
14


Actual output:
30


Fixed submission (verdict: Accepted):
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]:]))
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def get_input_line():
    return list(map(int, input().split()))
n, k = get_input_line()
h_list = get_input_line()

print(sum(h_list[k:]))

Failing test case input:
8 2
6 9 8 0 2 4 8 6

Expected output:
26


Actual output:
28


Fixed submission (verdict: Accepted):
def get_input_line():
    return list(map(int, input().split()))
n, k = get_input_line()
h_list = get_input_line()
h_list.sort()
h_list.reverse()

print(sum(h_list[k:]))

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
if n>k:
  ans=0
  for i in range(n-k-1):
    ans+=h[i]
  print(ans)
else:
  print(0)
  


Failing test case input:
3 0
1000000000 1101000100 1110000000

Expected output:
3211000100


Actual output:
2101000100


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
A = list(map(int, input().split()))
listsort=sorted(A, reverse=True)
print(listsort)
del listsort[0:K]
print(sum(listsort))

Failing test case input:
3 0
1100000011 1000000000 1110000000

Expected output:
3210000011


Actual output:
[1110000000, 1100000011, 1000000000]
3210000011


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int,input().split())
H = sorted(list(map(int,input().split())))

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


Failing test case input:
3 0
1000000000 1000000000 0110000000

Expected output:
2110000000


Actual output:
0


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
H = sorted(list(map(int,input().split())))

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

    

Failing test case input:
3 0
0000000000 1000000001 0110000000

Expected output:
1110000001


Actual output:
[0, 110000000, 1000000001]
1110000001


Fixed submission (verdict: Accepted):
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)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
teki_list = [i for i in map(int, input().split())]


teki_list.sort()

del teki_list[-k:]

print(sum(teki_list))


Failing test case input:
3 0
0000000000 0100000000 0110000000

Expected output:
210000000


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
teki_list = [i for i in map(int, input().split())]


teki_list.sort()

if k != 0:
    
    if k <= len(teki_list):
        del teki_list[-k:]
    else:
        del teki_list[:]

print(sum(teki_list))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
3 1
0000000000 1100000000 0110000000

Expected output:
110000000


Actual output:
<class 'int'>
110000000


Fixed submission (verdict: Accepted):
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)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
H=list(map(int,input().split()))
if N>K:
  H.sort()
  del H[N-K+1:]
  print(sum(H))
else:
  print(0)

Failing test case input:
8 1
4 9 9 2 3 4 5 6

Expected output:
33


Actual output:
42


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
li = list(map(int, input().split()))

li.sort()
print(sum(li[:-k]))


Failing test case input:
3 0
1000000000 1000000000 1010010000

Expected output:
3010010000


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
li = list(map(int, input().split()))

ans = 0
li.sort()
for i in range(n-k):
    ans = ans + li[i]
print(ans)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int,input().split())
print(sum(sorted(list(map(int,input().split())))[:n - k]))

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
n, k = map(int,input().split())
print(sum(sorted(list(map(int,input().split())))[:n - k]) if k < n else 0)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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

def calculate(n,k,arr):
    result = 0
    for i in range(n-k):
        result = result + arr[i]

    print(result)

calculate(N,K,ARR)

Failing test case input:
8 2
7 6 3 2 0 14 7 6

Expected output:
24


Actual output:
32


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
ARR = list(map(int,input().split()))

def calculate(n,k,arr):
    result = 0
    arr = sorted(arr)
    for i in range(n-k):
        result = result + arr[i]

    print(result)

calculate(N,K,ARR)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
s=list(map(int,input().split()))

if n<=k:
  print(0)
else:
  s.sort()
  print(sum(s[:-k]))

Failing test case input:
3 0
0000000100 0100010000 0110000000

Expected output:
210010100


Actual output:
0


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
s=list(map(int,input().split()))

if n<=k:
  print(0)
elif k==0:
  print(sum(s))
else:
  s.sort()
  print(sum(s[0:-k]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int, input().split())
H = list(map(int, input().split()))
sum = 0
l = n-k
sorted(H)
if k >= n : print(0)
else:
    for i in range(l):
        sum += H[i]
    print(sum)

Failing test case input:
8 1
4 9 9 0 6 4 16 6

Expected output:
38


Actual output:
48


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

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, k = map(int, input().split())
s = list(map(int, input().split()))
if k > len(s):
    k = len(s)
s = s[::-1]
print(sum(s[k:]))

Failing test case input:
8 1
4 9 9 2 3 4 5 6

Expected output:
33


Actual output:
36


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
s = list(map(int, input().split()))
if k > len(s):
    k = len(s)
s = sorted(s, reverse=True)

print(sum(s[k:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
H = sorted(list(map(int, input().split())))
if n <= k:
  print(0)
else:
  print(sum(H[:k+1]))


Failing test case input:
3 0
1000000000 1100000000 0110000000

Expected output:
2210000000


Actual output:
110000000


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
H = sorted(list(map(int, input().split())))
if n <= k:
  print(0)
else:
  print(sum(H[:n-k]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = (int(x) for x in input().split())
H = list(map(int, input().split()))

sum = 0

H = sorted(H)

answer = 0

for i in H[:N-K]:
    answer += i

print(answer) 

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
N,K = (int(x) for x in input().split())
H = list(map(int, input().split()))

sum = 0

H = sorted(H)

answer = 0

if N > K:
    for i in H[:N-K]:
        answer += i

print(answer)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
hp=list(map(int,input().split()))
sorted(hp)
re=sum(hp[:n-k])
print(re)


Failing test case input:
8 2
7 2 2 2 0 1 0 6

Expected output:
7


Actual output:
14


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
hp=list(map(int,input().split()))
hp.sort(reverse=True)
print(sum(hp[k:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
print(sum(l[:n-k]))


Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
print(sum(h[:max(0,n-k)]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
Hlist = list(map(int, input().split()))
Hlist.sort(reverse=True)
if K == 0:
  print(sum(Hlist))
elif K == 1:
  del Hlist[0]
  print(sum(Hlist))
else:
  del Hlist[0:K-1]
  print(sum(Hlist))

Failing test case input:
8 8
7 9 3 2 3 8 4 6

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
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))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
teki_list = [i for i in map(int, input().split())]


teki_list.sort()

if k <= len(teki_list):
    del teki_list[-k:]
else:
    del teki_list[:]

print(sum(teki_list))

Failing test case input:
3 0
0100000000 1001000001 1010000000

Expected output:
2111000001


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
teki_list = [i for i in map(int, input().split())]


teki_list.sort()

if k != 0:
    
    if k <= len(teki_list):
        del teki_list[-k:]
    else:
        del teki_list[:]

print(sum(teki_list))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
h = list(map(int,input().split()))
if n <= k:
    print(0)
else:
    h.sort()
    print(sum(h[:-k]))

Failing test case input:
3 0
1000000000 1000000000 0110000000

Expected output:
2110000000


Actual output:
0


Fixed submission (verdict: Accepted):
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()
    print(sum(h[:-k]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h,k = map(int,input().split(" "))
A = list(map(int,input().split(" ")))

n = len(A)
A.sort()
print(sum(A[:n-k]))

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
import sys
h,k = map(int,input().split(" "))
A = list(map(int,input().split(" ")))

n = len(A)
if k >= n:
    print(0)
    sys.exit(0)
A.sort()
print(sum(A[:n-k]))
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
H = list(map(int, input().split()))
H.sort()
print(sum(H[:N-K]))

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


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

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N,K = map(int,input().split())
H = list(map(int,input().split()))
if N<=K:
    print(0)
else:
    print(sum(H[:N-K]))

Failing test case input:
8 2
6 9 8 0 2 4 8 6

Expected output:
26


Actual output:
29


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
monsterList = [int(x) for x in input().split()]

atackTimes = 0

monsterList.sort()
for hp in monsterList[:-K]:
    atackTimes += hp

print(atackTimes)

Failing test case input:
8 0
2 16 5 2 3 6 5 6

Expected output:
45


Actual output:
0


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
monsterList = [int(x) for x in input().split()]

atackTimes = 0

monsterList.sort()
if K != 0:
    for hp in monsterList[:-K]:
        atackTimes += hp
else:
    for hp in monsterList:
        atackTimes += hp

print(atackTimes)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
hi=[]
for i in map(int,input().split()):
    hi.append(i)
hi.sort
hsum=0
for i in range(n-k):
    hsum=hsum+hi[i]
print(hsum)

Failing test case input:
8 1
4 9 5 2 0 6 5 6

Expected output:
28


Actual output:
31


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
hi=[]
for i in map(int,input().split()):
    hi.append(i)
if n<=k:
    print(0)
else:
    hi.sort()
    hsum=0
    for i in range(n-k):
        hsum=hsum+hi[i]
    print(hsum)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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)

Failing test case input:
3 0
0100000000 1000000001 1110000000

Expected output:
2210000001


Actual output:
0


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = list(map(int,input().split()))
h=list(map(int,input().split()))
h.sort()
print(sum(h[0:-k]))

Failing test case input:
3 0
1000000011 1010100001 1110000000

Expected output:
3120100012


Actual output:
0


Fixed submission (verdict: Accepted):
n,k = list(map(int,input().split()))
h=list(map(int,input().split()))
h.sort(reverse = True)
print(sum(h[k:]))
Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n, k = map(int, input().split())
    hl = list(map(int, input().split()))
    hl.sort()
    hl = hl[:k]
    print(sum(hl))
    return 


if __name__ == '__main__':
    main()


Failing test case input:
3 0
1000000000 1000000000 0110000000

Expected output:
2110000000


Actual output:
0


Fixed submission (verdict: Accepted):

import sys
sys.setrecursionlimit(12345678)
import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop


def main():
    n, k = map(int, input().split())
    hl = list(map(int, input().split()))
    hl.sort()
    rest = max(0, n-k)
    hl = hl[:rest]
    print(sum(hl))
    return


if __name__ == '__main__':
    main()

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

enemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print('0')

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

Failing test case input:
8 2
7 6 2 2 0 23 2 5

Expected output:
17


Actual output:
34


Fixed submission (verdict: Accepted):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = list(map(int,input().split()))

enemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print(0)

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

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
H,N = map(int,input().split())
H = list(map(int,input().split()))

H = sorted(H)
H = H[:len(H)-N]

if N >= len(H):
    print(0)
else:
    print(sum(H))

Failing test case input:
8 5
7 9 5 2 3 8 4 6

Expected output:
9


Actual output:
0


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
H = list(map(int,input().split()))

H = sorted(H)

if N < K:
    K = N

for i in range(K):
    del[H[-1]]

print(sum(H))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().split())
b = list(map(int, input().split()))

b.sort(reverse=True)
ans = 0

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

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

Failing test case input:
3 1
4 1 5

Expected output:
5

Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
b = list(map(int, input().split()))

b.sort(reverse=True)
ans = 0

del b[:k]
n -= k

if n < 0:
    print('0')
else:
    print(sum(b))
Problem: p02785
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N, K = map(int, input().split())
H = list(map(int, input().split()))
print(sum(H[:N-K]))

Failing test case input:
8 2
7 2 2 1 0 23 0 6

Expected output:
11


Actual output:
35


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k=map(int,input().split())
h=sorted(list(map(int,input().split())))
l=h[:-k]
print(sum(l))


Failing test case input:
3 0
1100000000 1000000001 1010000000

Expected output:
3110000001


Actual output:
0


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = map(int, input().strip().split())
hs = list(map(int, input().strip().split()))

n_attack = sum(hs[:-k]) if k < n else 0
print(n_attack)


Failing test case input:
3 0
1100000011 1010000000 1110000000

Expected output:
3220000011


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().strip().split())
hs = map(int, input().strip().split())
hs = list(sorted(hs, reverse=True))

n_attack = sum(hs[k:]) if k < n else 0
print(n_attack)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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



H = [int(x) for x in input().split()]
if K != 0:
    remaining = H[0:-K]
else:
    remaining = H[:]

print(sum(remaining))


Failing test case input:
8 1
4 9 6 0 3 4 13 6

Expected output:
32


Actual output:
39


Fixed submission (verdict: Accepted):

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

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = input().split()

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


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

print(countNormal)

Failing test case input:
8 2
4 2 3 1 0 23 10 6

Expected output:
16


Actual output:
['0', '1', '10', '2', '23', '3', '4', '6']
39


Fixed submission (verdict: Accepted):
enemmyCountN,killerTimeK = map(int,input().split())
enemyHp = list(map(int,input().split()))

enemyHp.sort()

resultEnemyCount = enemmyCountN - killerTimeK
countNormal = 0

if killerTimeK >= enemmyCountN:
    print(0)

else:
    for i in range(resultEnemyCount):
        countNormal += enemyHp[i]
    print(countNormal)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = (int(x) for x in input().split())
h=list(int(x) for x in input().split())
h.sort()

if n<k:
    print("0")
elif k == 0:
    print(sum(h))
else:
    n = h[:k+1]
    print(sum(n))

Failing test case input:
8 2
7 6 2 1 0 23 1 5

Expected output:
15


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = (int(x) for x in input().split())
h=list(int(x) for x in input().split())
h = sorted(h,reverse=True)
if n<k:
    print("0")
elif k == 0:
    print(sum(h))
else:
    n = h[k:]
    print(sum(n))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
H = list(map(int, input().split()))
sum = 0

H.sort()

H = H[0 : N - K]

for val in H:
  sum = sum + val
  
print(sum)

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
H = list(map(int, input().split()))
sum = 0

if K > N:
  	print(0)
else:
	H.sort()

	H = H[0 : N - K]

	for val in H:
  		sum = sum + val
  
	print(sum)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
data = input().split()
 
n = int(data[0])
k = int(data[1])

hpstr = input().split()
hp = []

for i in range(n):
  hp.append(int(hpstr[i]))

hp.sort()

print(hp)

ans = 0
for i in range(n - k):
  ans += hp[i]
 
print(ans)


Failing test case input:
3 0
0000000001 0100010000 0110000000

Expected output:
210010001


Actual output:
[1, 100010000, 110000000]
210010001


Fixed submission (verdict: Accepted):
data = input().split()
 
n = int(data[0])
k = int(data[1])
 
hpstr = input().split()
hp = []
 
for i in range(n):
  hp.append(int(hpstr[i]))
 
hp.sort()
 
ans = 0
for i in range(n - k):
  ans += hp[i]
 
print(ans)

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k= map(int,input().split())  
h =list(map(int,input().split()))
h.sort()
ans = sum(h[:k-2])

print(ans)

Failing test case input:
3 0
1000000000 1000000000 1010000000

Expected output:
3010000000


Actual output:
1000000000


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())  
h =list(map(int,input().split()))
if k>=n:
    print(0)
else:

    h.sort()
    ans = sum(h[:n-k])
    print(ans)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



N, K = input().split()
H_list = input().split()
H_list.sort(reverse=True)

count = 0
for i in range(int(K),len(H_list)):
    count += int(H_list[i])

print(count)

Failing test case input:
8 2
7 6 2 1 0 23 0 5

Expected output:
14


Actual output:
31


Fixed submission (verdict: Accepted):



N, K = [int(s) for s in input().split()]
H_list = [int(s) for s in input().split()]
H_list.sort(reverse=True)

if N < K:
    K = N

for i in range(int(K)):
    H_list[i] = 0

print(sum(H_list))
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int,input().split())

H = list(input().split())

H.sort()

sum = 0;

for i in range(N-K):
    sum = sum+int(H[i])
    
print(sum)



Failing test case input:
8 2
7 6 3 1 0 23 7 6

Expected output:
23


Actual output:
39


Fixed submission (verdict: Accepted):
N, K = map(int,input().split())

H = [int(x) for x in list(input().split())]

H.sort()

sum = 0

for i in range(N-K):
    sum = sum+int(H[i])
    
print(sum)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int, input().split())
A = list(map(int, input().split()))

A.sort
if N > K:
  for i in range(K):
    A.pop()
  print(A)
else:
  print("0")




Failing test case input:
3 0
1100000011 1010100000 1110000000

Expected output:
3220100011


Actual output:
[1100000011, 1010100000, 1110000000]


Fixed submission (verdict: Accepted):
N,K = map(int, input().split())
A = list(map(int, input().split()))

A.sort()
if N > K:
  for i in range(K):
    A.pop()
  print(sum(A))
else:
  print("0")

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from heapq import heapify, heappop
from math import ceil
N, K = map(int, input().split())
H = list(map(int, input().split()))




Hminus = list(map(lambda x: x*(-1), H))

heapify(Hminus)

if K > len(H):
    print(len(H))
else:
    for _ in range(K):
        heappop(Hminus)
    print(sum(Hminus)*(-1))

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
8


Fixed submission (verdict: Accepted):
from heapq import heapify, heappop
from math import ceil
N, K = map(int, input().split())
H = list(map(int, input().split()))




Hminus = list(map(lambda x: x*(-1), H))

heapify(Hminus)

if K > len(H):
    print(0)
else:
    for _ in range(K):
        heappop(Hminus)
    print(sum(Hminus)*(-1))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = [int(x) for x in input().split()]

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

if n < k:
    print("0")

s_n = sorted(h_n)

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

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
0
33


Fixed submission (verdict: Accepted):
import math

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

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

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

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
h = list(map(int,input().split()))

if n < k:
    print('0')

h.sort()
l = h[0:(n-k)]

print(sum(l))

Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
0
33


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
h = list(map(int,input().split()))

if n < k:
    print('0')
else:
    h.sort()
    l = h[0:(n-k)]

    print(sum(l))
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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()
    t = h[n-k:]
    print(sum(t))


Failing test case input:
8 2
4 2 3 1 0 23 10 6

Expected output:
16


Actual output:
33


Fixed submission (verdict: Accepted):
n, k = map(int ,input().split())
h = list(map(int ,input().split()))

if n <= k:
    print(0)
elif k == 0:
    print(sum(h))
elif n > k:
    h.sort(reverse=True)
    t = h[k:]
    print(sum(t))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))
h.sort()
print(sum(h[0:len(h)-k]))


Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


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

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from collections import deque

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

D = deque(H)

for _ in range(K):
    if N == 0:
        break
    D.pop()
    N -= 1

print(D)


Failing test case input:
8 0
4 12 5 2 3 6 5 6

Expected output:
43


Actual output:
deque([2, 3, 4, 5, 5, 6, 6, 12])


Fixed submission (verdict: Accepted):
from collections import deque

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

D = deque(H)

for _ in range(K):
    if N == 0:
        break
    D.pop()
    N -= 1

print(sum(D))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = [int(i) for i in input().split()]
H = sorted([int(i) for i in input().split()])

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

Failing test case input:
8 8
7 9 3 2 3 8 4 6

Expected output:
0


Actual output:
42


Fixed submission (verdict: Accepted):
N, K = [int(i) for i in input().split()]
H = sorted([int(i) for i in input().split()])

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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N , K = map(int, input().split())
H = [int(i) for i in input().split()]

r = 0 
e = 0 

if N <= K:
    print(0)

elif K == 0:
        print(sum(H))
else:
    H.reverse()
    for i in range(K):
        H.pop(0)
    else:
        print(sum(H))

Failing test case input:
8 1
4 9 6 0 3 4 13 6

Expected output:
32


Actual output:
39


Fixed submission (verdict: Accepted):
N , K = map(int, input().split())
H = [int(i) for i in input().split()]


if N <= K:
    print(0)

elif K == 0:
    print(sum(H))

else:
    H.sort()
    H.reverse()
    print(sum(H[K:N]))
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K = map(int,input().split())
H = [int(i) for i in input().split()]

if K >= N:
  print(0)
else:
  I = sorted(H)
  a = 0
  for i in range(N-K):
    a += H[i]
  print(a)


Failing test case input:
3 1
1000000100 1000010000 1000000000

Expected output:
2000000100


Actual output:
2000010100


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
H = [int(i) for i in input().split()]

if K >= N:
  print(0)
else:
  I = sorted(H)
  a = 0
  for i in range(N-K):
    a += I[i]
  print(a)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N , K = map(int, input().split())
H = [int(i) for i in input().split()]


if N <= K:
    print(0)

elif K == 0:
        print(int(sum(H)))

else:
    H.reverse()
    print(int(sum(H[K:N])))

Failing test case input:
8 2
7 2 3 1 0 23 10 6

Expected output:
19


Actual output:
36


Fixed submission (verdict: Accepted):
N , K = map(int, input().split())
H = [int(i) for i in input().split()]


if N <= K:
    print(0)

elif K == 0:
    print(sum(H))

else:
    H.sort()
    H.reverse()
    print(sum(H[K:N]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int,input().split())
H = list(map(int,input().split()))

H.reverse()

cnt = 0

for i in range(K,len(H)):
    cnt += H[i]

print(cnt)

Failing test case input:
8 2
7 2 3 1 0 23 10 6

Expected output:
19


Actual output:
36


Fixed submission (verdict: Accepted):
N, K = map(int,input().split())
H = list(map(int,input().split()))

H = sorted(H,reverse = True)

print(sum(H[K:]))

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):




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

if k >= n:
    print(0)
    exit()
else:
    for i in range(k):
        h.pop()

print(sum(h))

Failing test case input:
8 2
7 6 2 2 0 23 2 5

Expected output:
17


Actual output:
40


Fixed submission (verdict: Accepted):
n,k= map(int,input().split())
h = list(map(int,input().split()))
h.sort()

if k >= n:
    print(0)
    exit()
else:
    for i in range(k):
        h.pop()

print(sum(h))

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
H = list(map(int, input().split()))





H = sorted(H, reverse=True)
ans = K
if N > K: ans += sum(H[K:])
  
print(ans)

Failing test case input:
8 2
7 6 2 1 0 23 10 5

Expected output:
21


Actual output:
23


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
H = list(map(int, input().split()))
 





H = sorted(H, reverse=True)
ans = 0
if N > K: ans = sum(H[K:])
  
print(ans)

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int, input().split())
L = list(map(int, input().split()))

L.sort()
print(sum(L[:N-K])) 


Failing test case input:
8 9
7 9 3 2 3 8 4 6

Expected output:
0

Actual output:
33


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
L = list(map(int, input().split()))

L.sort()
if K > N:
    print(0)
else:
    print(sum(L[:N-K]))