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

import sys


def solve(N: int, A: "List[int]"):
    from collections import Counter
    c = Counter(A)

    
    
    m = sum([v for v in c.values()]) - len([c for c in c.keys()])
    if(m%3 == 0 or m%3 == 2):
        print(len(c.keys()))
    elif(m%3 == 1):
        print(len(c.keys())-1)
    
    
    
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, A)

if __name__ == '__main__':
    main()


Failing test case input:
15
1 1 9 0 0 4 1 -1 11 6 -1 2 10 2 3

Expected output:
9


Actual output:
10


Fixed submission (verdict: Accepted):

import sys


def solve(N: int, A: "List[int]"):
    from collections import Counter
    c = Counter(A)

    
    
    
    m = sum([v for v in c.values()])
    cl = len([c for c in c.keys()])

    while(m > cl):
        m -= 2
    
    
    
    
    
    
    print(m)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = [int(next(tokens)) for _ in range(N)]  
    solve(N, A)

if __name__ == '__main__':
    main()

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def Main():
  n = int(input())
  A = list(map(int, input().split()))
  s = set(A)
  print(len(s))
if __name__ == '__main__':
  Main()

Failing test case input:
5
2 2 -1 9 12

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
def Main():
  n = int(input())
  A = list(map(int, input().split()))
  s = set(A)

  if len(s)%2 == 0:
    print(len(s) - 1)
  else:
    print(len(s))

if __name__ == '__main__':
  Main()

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
if len(a) % 2 == 1:
    print(len(list(set(a))))
else:
    print(len(list(set(a))) - 1)


Failing test case input:
15
1 1 9 0 0 4 1 -1 11 6 -1 2 13 2 3

Expected output:
9


Actual output:
10


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
if len(list(set(a))) % 2 == 1:
    print(len(list(set(a))))
else:
    print(len(list(set(a))) - 1)

Problem: p03816
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
d=[0]*(10**5+1)
sa=set(a)
for i in a:
  d[i]+=1
for j in range(len(d)):
  if d[j]>2 and d[j]%2==0:
    d[j]=2
  elif d[j]>2 and d[j]%2!=0:
    d[j]=1
iti=d.count(1)
dsum=sum(d)-iti
if dsum%2==0:
  print(len(sa))
else:
  print(len(sa)-1)

Failing test case input:
5
4 -2 0 4 1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
d=[0]*(10**5+1)
sa=set(a)
for i in a:
  d[i]+=1
for j in range(len(d)):
  if d[j]>2 and d[j]%2==0:
    d[j]=2
  elif d[j]>2 and d[j]%2!=0:
    d[j]=1
ni=d.count(2)
if ni%2==0:
  print(len(sa))
else:
  print(len(sa)-1)
Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
a.sort()
eq={}
for i in range(n-1):
  if a[i]==a[i-1]:
    if a[i] in eq:
      eq[a[i]]+=1
    else:
      eq[a[i]]=1
sousa=0
for i in eq.values():
  sousa+=i
eat=(sousa+1)
print(n-eat*2)

Failing test case input:
5
0 -2 -2 1 3

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
a.sort()
eq={}
for i in range(n-1):
  if a[i]==a[i+1]:
    if a[i] in eq:
      eq[a[i]]+=1
    else:
      eq[a[i]]=1
sousa=0
for i in eq.values():
  sousa+=i
if sousa%2==0:
  print(n-sousa)
else:
  print(n-sousa-1)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = LIST()

A_cnt = Counter(A)
tmp = 0
for x in A_cnt.values():
	if x >= 2:
		tmp += x
print(len(A_cnt)-1 if tmp % 2 == 0 else len(A_cnt))


Failing test case input:
15
1 12 6 0 1 2 2 0 8 6 2 6 11 1 3

Expected output:
7


Actual output:
8


Fixed submission (verdict: Accepted):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = LIST()

A_cnt = Counter(A)
tmp = 0
for x in A_cnt.values():
	if x >= 2:
		tmp += x-1
print(len(A_cnt) if tmp % 2 == 0 else len(A_cnt)-1)
Problem: p03816
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def comp(n,s,a):
  cnt=1
  flag=s[0]
  for i in range(1,n):
    if flag==s[i]:cnt+=1
    else:
      flag=s[i]
      a+=[cnt]
      cnt=1
  a+=[cnt]
  return a
n=int(input())
a=sorted(list(map(int,input().split())))
b=comp(n,a,[])
l,r=0,len(b)-1
while l<r:
  while b[l]==1 and l<r:l+=1
  while b[r]==1 and l<r:r-=1
  b[l]-=1
  b[r]-=1
print(sum(b))

Failing test case input:
5
1 2 -1 9 16

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
def comp(n,s,a):
  cnt=1
  flag=s[0]
  for i in range(1,n):
    if flag==s[i]:cnt+=1
    else:
      flag=s[i]
      a+=[cnt]
      cnt=1
  a+=[cnt]
  return a
n=int(input())
a=sorted(list(map(int,input().split())))
b=comp(n,a,[])
l,r=0,len(b)-1
if l==r:b[0]=1
while l<r:
  while b[l]==1 and l<r:l+=1
  while b[r]==1 and l<r:r-=1
  if b[l]>1:
    b[l]-=1
    b[r]-=1
while b[l]>1:b[l]-=2
print(sum(b))

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import*
n,*a=map(int,open(0).read().split())


amaricard=n-sum([v-1 for k,v in Counter(a).items() if v>1 and (v-3)%2==0])
amari=[v-1 for k,v in Counter(a).items() if v>1 and (v-3)%2!=0]

if len(amari)==0:
    print(n)
else:
    print(amaricard-sum(amari)-len(amari)%2)

Failing test case input:
15
1 12 6 0 1 4 3 0 16 6 0 6 3 1 3

Expected output:
7


Actual output:
15


Fixed submission (verdict: Accepted):
from collections import*
n,*a=map(int,open(0).read().split())


amaricard=n-sum([v-1 for k,v in Counter(a).items() if v>1 and (v-3)%2==0])
amari=[v-1 for k,v in Counter(a).items() if v>1 and (v-3)%2!=0]

if len(amari)==0:
    print(amaricard)
else:
    print(amaricard-sum(amari)-len(amari)%2)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
N = int( input())
A = list( map( int, input().split()))
CA = Counter(A)
V = []
for x in CA:
    if CA[x] >= 2:
        V.append(CA[x]-1)
V.sort(key = None, reverse = True)
now = 0
ans = 0
for v in V:
    ans += v
    if now <= 0:
        now += v
    else:
        now -= v
ans += abs(now)
print( max(N-ans,0))

Failing test case input:
15
1 14 6 0 0 4 1 -1 19 6 0 6 5 1 3

Expected output:
9


Actual output:
7


Fixed submission (verdict: Accepted):
from collections import Counter
N = int( input())
A = list( map( int, input().split()))
CA = Counter(A)
V = []
for x in CA:
    if CA[x] >= 2:
        V.append(CA[x]-1)
V.sort(key = None, reverse = True)
now = 0
ans = 0
for v in V:
    ans += v
    if now <= 0:
        now += v
    else:
        now -= v
b = abs(now)
if b == 0:
    pass
elif b%2 == 1:
    ans += 1
else:
    pass
print( max(N-ans,0))
Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict

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

for i in a:
    d[i] += 1
cnt = 0
ans = 0
for k, v in d.items():
    if v != 1:
        cnt += v
    ans += 1

if cnt == 0:
    print(ans - 2)
elif cnt == 1:
    print(ans - 1)
elif ans % 2 == 0 and cnt % 2 == 0:
    print(ans - 1)
elif ans % 2 == 0 and cnt % 2 != 0:
    print(ans)
elif ans % 2 != 0 and cnt % 2 == 0:
    print(ans - 1)
else:
    print(ans)

Failing test case input:
5
2 -1 -4 16 27

Expected output:
5


Actual output:
3


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

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

for i in a:
    d[i] += 1
cnt = 0
ans = 0
for k, v in d.items():
    if v != 1:
        cnt += v - 1
    ans += 1

if cnt == 0:
    print(ans)
elif cnt == 1:
    print(ans - 1)
elif cnt % 2 == 0:
    print(ans)
else:
    print(ans - 1)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())

A = list(map(int, input().split()))
if len(A)==3:
  print(1)
elif len(A)-len(set(A))%2==1:
  print(len(set(A))-1)
else:
  print(len(set(A)))

Failing test case input:
5
4 -2 0 1 1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N=int(input())

A = list(map(int, input().split()))
if len(A)==3:
  print(1)
elif (len(A)-len(set(A)))%2==1:
  print(len(set(A))-1)
else:
  print(len(set(A)))

Problem: p03816
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()
if len(array) == len(list(set_array)): print(0);sys.exit()

diff_len_arrays = len(array) - len(list(set_array))
print(len(array) - math.ceil(diff_len_arrays / 2)*2)

Failing test case input:
5
2 0 -1 8 12

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()

print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array)) - 1)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter


def solve(N, As):
    print(N, ",", As)
    counter = Counter(As)
    if len(counter) % 2 == 0:
        return len(counter) - 1
    return len(counter)

if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))


Failing test case input:
15
1 3 5 2 1 3 2 8 8 6 2 6 11 1 1

Expected output:
7

Actual output:
15 , [1, 3, 5, 2, 1, 3, 2, 8, 8, 6, 2, 6, 11, 1, 1]
7


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


def solve(N, As):
    counter = Counter(As)
    if len(counter) % 2 == 0:
        return len(counter) - 1
    return len(counter)

if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))
Problem: p03816
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from collections import Counter
from operator import itemgetter
N = int(input())
A = Counter(map(int, input().split()))
ans = 0
left = 0
for k, v in sorted(A.items(), key=itemgetter(1))[::-1]:
    print(k, v, left, ans)
    if left == 1:
        if v == 1:
            ans += 1
            left = 0
            continue
        else:
            v -= 1
            ans += 1
            left = 0
    if v > 3:
        v = v%2 + 2

    if v == 1:
        ans += 1
    elif v == 2:
        left += 1
    elif v == 3:
        ans += 1

print(ans)


Failing test case input:
15
1 12 6 0 1 2 2 0 8 6 2 6 11 1 3

Expected output:
7


Actual output:
2 3 0 0
6 3 0 1
1 3 0 2
0 2 0 3
3 1 1 3
11 1 0 4
8 1 0 5
12 1 0 6
7


Fixed submission (verdict: Accepted):
from collections import Counter
from operator import itemgetter
N = int(input())
A = Counter(map(int, input().split()))
ans = 0
left = 0
for k, v in sorted(A.items(), key=itemgetter(1))[::-1]:
    if left == 1:
        if v == 1:
            ans += 1
            left = 0
            continue
        else:
            v -= 1
            ans += 1
            left = 0
    if v > 3:
        v = v%2 + 2

    if v == 1:
        ans += 1
    elif v == 2:
        left += 1
    elif v == 3:
        ans += 1

print(ans)

Problem: p03816
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()
if len(array) == len(list(set_array)): print(0);sys.exit()

print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array)) - 1)

Failing test case input:
5
1 -1 -4 16 18

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
import sys
import math
N = int(input())
array = list(map(int,input().split()))
set_array = set(array)

if not ( 3 <= N <= 10**5 and N % 2 == 1 ): sys.exit()

print(len(list(set_array))) if len(list(set_array)) % 2 == 1 else print(len(list(set_array)) - 1)

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

N=int(input())
lis=list(map(int, input().split()))
kind=list(set(lis))
kindn=len(kind)
out=0
for i in kind:
    if lis.count(i)&1:
        out+=1
if out%2==0:
    print(kindn)
else:
    print(kindn-1)

Failing test case input:
15
0 -4 1 8 0 1 -1 -25 49 -3 -35 -2 -8 2 -9

Expected output:
13


Actual output:
12


Fixed submission (verdict: Accepted):

import time
import collections
N=int(input())
lis=list(map(int, input().split()))


kind_dict=collections.Counter(lis)
kindn=len(kind_dict)
out=0
for i in kind_dict:
    if kind_dict[i]%2==0:
        out+=1
if out%2==0:
    print(kindn)
else:
    print(kindn-1)
Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections

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

a.sort()
x=0
b=set(a)
b=list(b)
for i in range(len(b)):
    if a.count(b[i])!=1:
        x+=a.count(b[i])
        
y=len(b)

if x%2==1 or x==0:
    print(y)

else:
    print(y-1)
    



    

    
    
    





Failing test case input:
15
1 1 9 -1 0 12 1 -1 0 6 -1 2 13 2 3

Expected output:
9


Actual output:
8


Fixed submission (verdict: Accepted):
import collections
n=int(input())
a=list(map(int, input().split())) 

a.sort()
x=0
count=0
b=set(a)
b=list(b)

c = collections.Counter(a)
c=c.most_common()
for i in range(len(c)):
    if c[i][1]!=1:
        x+=c[i][1]-1
    else:
        break
y=len(b)
if x%2==0:
    print(y)

else:
    print(y-1)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import defaultdict

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

for i in a:
    d[i] += 1

cnt = 0
ans = 0
for k, v in d.items():
    if v != 1:
        cnt += v
    ans += 1

if cnt != 0 and cnt % 2 == 0:
    print(ans - 1)
else:
    print(ans)

Failing test case input:
15
1 6 6 0 1 2 2 0 8 6 2 6 11 1 3

Expected output:
7


Actual output:
6


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

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

for i in a:
    d[i] += 1
cnt = 0
ans = 0
for k, v in d.items():
    if v != 1:
        cnt += v - 1
    ans += 1

if cnt == 0:
    print(ans)
elif cnt == 1:
    print(ans - 1)
elif cnt % 2 == 0:
    print(ans)
else:
    print(ans - 1)

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



nb_int = int(input())
A = list(map(int, input().split(" ")))


uniq_A = list(set(A))



if (nb_int - len(uniq_A)) % 2 == 1:
    print(len(uniq_A)+1)
else:
    print(len(uniq_A))

Failing test case input:
15
1 1 9 0 0 4 1 -1 11 6 -1 2 13 2 3

Expected output:
9


Actual output:
11


Fixed submission (verdict: Accepted):



nb_A = int(input())
A = list(map(int, input().split(" ")))

uniq_A = list(set(A))

if (nb_A - len(uniq_A)) % 2 == 1:
    print(len(uniq_A)-1)
else:
    print(len(uniq_A))

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
D = {}
for a in A:
    if a not in D: D[a] = 0
    D[a] += 1

n2 = 0
for k in D:
    D[k] = 2 if D[k]%2==0 else 1
    if D[k]==2: n2+=1

print(len(D) + n2%2)

Failing test case input:
15
1 12 6 0 1 2 2 0 8 6 2 6 21 1 3

Expected output:
7


Actual output:
9


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
D = {}
for a in A:
    if a not in D: D[a] = 0
    D[a] += 1

n2 = 0
for k in D:
    D[k] = 2 if D[k]%2==0 else 1
    if D[k]==2: n2+=1

print(len(D) - n2%2)
Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())
A = list(map(int, input().split()))

B = [0] * 100001
for a in A:
    B[a] += 1
cnt2 = 0
cnt1 = 0
ans = 0
for b in B:
    if b > 2:
        cnt2 += 1
    if b > 1:
        cnt1 += 1
    if b > 0:
        ans += 1
if cnt1 % 2 == 1 and cnt2 == 0:
    ans -= 1
print(ans)

Failing test case input:
15
1 1 9 0 0 4 1 -1 11 6 -1 1 10 2 3

Expected output:
9


Actual output:
10


Fixed submission (verdict: Accepted):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())
A = list(map(int, input().split()))

B = [0] * 100001
for a in A:
    B[a] += 1
cnt1 = 0
ans = 0
for b in B:
    if b > 1 and b % 2 == 0:
        cnt1 += 1
    if b > 0:
        ans += 1
if cnt1 % 2 == 1:
    ans -= 1
print(ans)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = sorted(list(map(int, input().split())))
count = 1
for i in range(N-1):
    if a[i] != a[i-1]:
        count += 1
if count % 2 == 0:
    count -= 1
print(count)

Failing test case input:
5
3 -1 -2 1 3

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
a = sorted(list(map(int, input().split())))
count = 1
for i in range(N-1):
    if a[i] != a[i+1]:
        count += 1
if count % 2 == 0:
    count -= 1
print(count)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input()
a = list(map(int, input().split()))
c = {}
lb = lc = 0
for i in a:
  try:
    c[i] += 1
    lb += 1
  except:
    c[i] = 1
    lc += 1
print(c)
print(lc if lb % 2 == 0 else lc-1)

Failing test case input:
15
1 1 9 -1 0 12 1 -1 1 6 -1 2 13 2 3

Expected output:
9


Actual output:
{1: 4, 9: 1, -1: 3, 0: 1, 12: 1, 6: 1, 2: 2, 13: 1, 3: 1}
9


Fixed submission (verdict: Accepted):
input()
a = list(map(int, input().split()))
c = {}
lb = lc = 0
for i in a:
  try:
    c[i] += 1
    lb += 1
  except:
    c[i] = 1
    lc += 1
print(lc if lb % 2 == 0 else lc-1)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
x = int(input())
a = list(map(int,input().split()))
c = Counter(a)
sa = 0
b = 0
for v in c.values():
    sa += v
    if v > 1:
        b += v - 1

if b == 0:
    print(0)
    exit()
    
d = b 
if b % 2 == 1:
    d += 1    
print(sa - d * 2)

Failing test case input:
15
1 14 6 0 0 4 1 0 16 6 0 6 5 0 3

Expected output:
7


Actual output:
-1


Fixed submission (verdict: Accepted):
from collections import Counter
x = int(input())
a = list(map(int,input().split()))
c = Counter(a)

suma = sum([v for v in c.values()])
lenc = len(c)
if suma == lenc:
    print(suma)
    exit()
    
b = suma - lenc
if b % 2 == 0:
    print(lenc)
else:
    print(lenc - 1)
Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
x = int(input())
a = list(map(int,input().split()))
c = Counter(a)

suma = sum([v for v in c.values()])
lenc = len(c)
if suma == lenc:
    print(0)
    exit()
    
b = suma - lenc  
if b % 2 == 0:
    print(lenc)
else:
    print(lenc - 1)

Failing test case input:
5
1 -1 -4 8 18

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
from collections import Counter
x = int(input())
a = list(map(int,input().split()))
c = Counter(a)

suma = sum([v for v in c.values()])
lenc = len(c)
if suma == lenc:
    print(suma)
    exit()
    
b = suma - lenc
if b % 2 == 0:
    print(lenc)
else:
    print(lenc - 1)

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

import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
most = c.most_common()
ans = len(most)
eaten = 0
for t in most:
    if t[1] != 1:
        eaten += t[1]-1
if eaten%3 == 1:
    print(ans-1)
elif eaten%3 == 2:
    print(ans)
else:
    print(ans-2)

Failing test case input:
15
1 1 6 0 0 4 1 -2 11 6 0 10 5 1 3

Expected output:
9


Actual output:
7


Fixed submission (verdict: Accepted):

import collections
N = int(input())
A = list(map(int,input().split()))
c = collections.Counter(A)
most = c.most_common()
ans = len(most)
eaten = 0
for t in most:
    if t[1] != 1:
        eaten += t[1]-1
if eaten%2 == 1:
    print(ans-1)
else:
    print(ans)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
s = set()
d = dict()
for i in a:
	if i not in s:
		d[i] = 1
		s.add(i)
	else:
		d[i] += 1
l = list(d.values())
l.sort(reverse=True)
cnt = l.count(1)
if cnt == len(l):
	print(0)
else:
	diff = len(l) - cnt
	su = 0
	for i in l:
		if i!=1:
			su += (i-1)
		else:
			break
	if su%2==0:
		print(len(l))
	else:
		print(len(l)-1)

Failing test case input:
5
1 2 0 3 7

Expected output:
5


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
s = set()
d = dict()
for i in a:
	if i not in s:
		d[i] = 1
		s.add(i)
	else:
		d[i] += 1
l = list(d.values())
l.sort(reverse=True)
cnt = l.count(1)
if cnt == len(l):
	print(len(l))
else:
	diff = len(l) - cnt
	su = 0
	for i in l:
		if i!=1:
			su += (i-1)
		else:
			break
	if su%2==0:
		print(len(l))
	else:
		print(len(l)-1)

Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(input().split())
ans=len(set(a))
if ans%2==0:
    ans-1
print(ans)

Failing test case input:
5
2 -2 -2 1 3

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
a=list(input().split())
ans=len(set(a))
if ans%2 == 0:
    ans -= 1
print(ans)
Problem: p03816
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=set(map(int,input().split()))
k=len(a)

if n-k % 2 == 0:
  print(k)
else:
  print(k-1)

Failing test case input:
5
2 -1 -6 16 27

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
a=set(map(int,input().split()))
k=len(a)

if (n-k) % 2 == 0:
  print(k)
else:
  print(k-1)
Problem: p02442
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] < b[i]:
        print(0)
        break
    elif a[i] > b[i]:
        print(1)
        break
else:
    if la < lb:
        print(0)
    else:
        print(1)


Failing test case input:
3
1 0 -1
6
7 0

Expected output:
1


Actual output:
0


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

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] > b[i]:
        print(0)
        break
    elif a[i] < b[i]:
        print(1)
        break
else:
    if la >= lb:
        print(0)
    else:
        print(1)

Problem: p02442
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] < b[i]:
        print(1)
        break
    elif a[i] > b[i]:
        print(2)
        break
else:
    if la < lb:
        print(1)
    else:
        print(2)


Failing test case input:
4
1 4 1 1
2
-1 4 5 4 2

Expected output:
0


Actual output:
2


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

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] > b[i]:
        print(0)
        break
    elif a[i] < b[i]:
        print(1)
        break
else:
    if la >= lb:
        print(0)
    else:
        print(1)

Problem: p02442
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
m = int(input())
b = list(map(int, input().split()))

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] > b[i]:
        print(0)
        break
    elif a[i] < b[i]:
        print(1)
        break
else:
    if la < lb:
        print(0)
    else:
        print(1)


Failing test case input:
3
1 1 2
4
1 1 2 2

Expected output:
1

Actual output:
0


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

la = len(a)
lb = len(b)
l = min(la, lb)

for i in range(l):
    if a[i] > b[i]:
        print(0)
        break
    elif a[i] < b[i]:
        print(1)
        break
else:
    if la >= lb:
        print(0)
    else:
        print(1)
Problem: p02442
Buggy submission (Python3, verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split(' ')))
m = int(input())
b = list(map(int, input().split(' ')))

loop_num = n if n <= m else m
for i in range(loop_num):
    if a[i] < b[i]:
        print(1)
        break
    elif a[i] > b[i]:
        print(0)
        break

if len(a) < len(b):
    print(1)
else:
    print(0)


Failing test case input:
3
-1 0 4
5
0 6 3 14

Expected output:
1


Actual output:
1
1


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

rst = None

loop_num = n if n <= m else m
for i in range(loop_num):
    if a[i] < b[i]:
        rst = 1
    elif a[i] > b[i]:
        rst = 0
    if rst != None: break

if rst == None:
    if len(a) < len(b):
        rst = 1
    else:
        rst = 0

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

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


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

Expected output:
29


Actual output:
29
[7, 7, 3, 3, 2]


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):
N,K=(int(x) for x in input().split())
a=list(int(y) for y in input().split())
b=sorted(a)
print(sum(b[0: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=(int(x) for x in input().split())
a=list(int(y) for y in input().split())
b=sorted(a)
if N<=K:
    print('0')
else:
    print(sum(b[0:N-K]))

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

    deleat(num,k)

def deleat(lst, cun):
    sorted(lst)
    del lst[-cun:]
    print(sum(lst))
main()


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

Expected output:
19


Actual output:
36


Fixed submission (verdict: Accepted):
def main():
    n, k = [int(i) for i in input().split()]
    num = [int(i) for  i in input().split()]
    if k >= n:
        return 0
    else:
        num = sorted(num)
        return sum(num[0:n-k])
print(main())

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
c.sort()
d=sum(c)
e=0
if a<b:
  print(0)
else:
  for i in range(b):
    e=e+c[-b]
  print(d-e)

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

Expected output:
0


Actual output:
26


Fixed submission (verdict: Accepted):
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
c.sort()
d=sum(c)
e=0
if a<=b:
  print(0)
else:
  for i in range(1,b+1):
    e=e+c[-i]
  print(d-e)

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

ls = sorted(ls)

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

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

Expected output:
34


Actual output:
25


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

ls = sorted(ls)


if len(ls)<k+1:
  print(0)
else:
  print(sum(ls[:-k]) if k>0 else sum(ls))
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]))
elif K > N:
    print(N)
else:
    print(sum(H))

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

Expected output:
0

Actual output:
8


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

Failing test case input:
3 0
0000000000 1100000000 0110000000

Expected output:
1210000000


Actual output:
[0, 110000000, 1100000000]
1210000000


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

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

Problem: p02785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
h,k = map(int,input().split())
lst = list(map(int,input().split()))
lst.sort()
print(sum(lst[:len(lst)-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):
h,k = map(int,input().split())
lst = list(map(int,input().split()))
lst.sort()
if len(lst) >= k + 1:
  print(sum(lst[:len(lst)-k]))
else:
  print(0)

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
l=list(map(int,input().split()))
if(k==0):
  print(sum(l))
else:
  l=sorted(l)
  l=l[k:]
  print(sum(l))

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

Expected output:
13


Actual output:
41


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
l=list(map(int,input().split()))
if(k==0):
  print(sum(l))
else:
  l=sorted(l,reverse=True)
  l=l[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()))
sorted(h)
if k >0:
    print(sum(h[k+1:]))
else:
    print(sum(h))

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

Expected output:
35


Actual output:
31


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, K = map(int,input().split())
N_hp = list(map(int,input().split()))
N_hp.sort(reverse=True)
del N_hp[:K]
sum_turn = sum(N_hp)
print(K+sum_turn)

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

Expected output:
29


Actual output:
31


Fixed submission (verdict: Accepted):
N, K = map(int,input().split())
N_hp = list(map(int,input().split()))
N_hp.sort(reverse=True)
del N_hp[:K]
sum_turn = sum(N_hp)
print(sum_turn)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H.sort()
    print(0 if N<=K else sum(H[-K:]))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    solve(N, K, H)

if __name__ == '__main__':
    main()


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

Expected output:
27


Actual output:
15


Fixed submission (verdict: Accepted):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H.sort()
    print(0 if N<=K else sum(H[:N-K]))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    solve(N, K, H)

if __name__ == '__main__':
    main()

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


Failing test case input:
3 0
0000000000 1000000001 0110000000

Expected output:
1110000001


Actual output:
0


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = (int(x) for x in input().split())
h_lst = [int(x) for x in input().split()]
h_lst.sort()
del h_lst[(-1)*k:]
print(sum(h_lst))


Failing test case input:
3 0
1110000000 1000000000 0110000100

Expected output:
2220000100


Actual output:
0


Fixed submission (verdict: Accepted):
n,k = (int(x) for x in input().split())
h_lst = [int(x) for x in input().split()]
h_lst.sort()
if k != 0:
    del h_lst[(-1)*k:]
print(sum(h_lst))

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[:(n - k)]
    print(sum(hl))
    return


if __name__ == '__main__':
    main()


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
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.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
ans=0
for i in range(n-k-1):
  ans+=h[i]
print(ans)

Failing test case input:
3 1
0000000000 1100000000 0110000000

Expected output:
110000000


Actual output:
0


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


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

Expected output:
4


Actual output:
7


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

Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
R = lambda: map(int, input().split())
n, k = R()
print(sum(sorted(R())[: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):
R = lambda: map(int, input().split())
n, k = R()
print(sum(sorted(R())[:n - min(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.sort()
if n > k:
    print(sum(h[:n-k]))
else:
    print(k)

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

Expected output:
0


Actual output:
8


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

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:]

print(sum(H))

Failing test case input:
8 0
6 9 5 0 3 4 8 6

Expected output:
41


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 = [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))

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

ls = sorted(ls)

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


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

Expected output:
47


Actual output:
0


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

ls = sorted(ls)


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

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

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

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

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

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

bodies_count = list(map(int,input().split()))
enemy_life = list(map(int,input().split()))

if bodies_count[1] == 0:
    print(sum(enemy_life))
else:
    enemy_life.sort(reverse=True)
    if bodies_count[1] == 1:
        del enemy_life[0] 
    else:
        a = bodies_count[1]-1
        del enemy_life[0:a]

    if enemy_life != []:
        print(sum(enemy_life))
    else:
        print(0)
    
    
    
    
    
    
    
    



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

Expected output:
19


Actual output:
29


Fixed submission (verdict: Accepted):

bodies_count = list(map(int,input().split()))
enemy_life = list(map(int,input().split()))

if bodies_count[1] == 0:
    print(sum(enemy_life))
else:
    enemy_life.sort(reverse=True)
    if bodies_count[1] == 1:
        del enemy_life[0] 
    else:
        a = bodies_count[1]
        del enemy_life[0:a]

    if enemy_life != []:
        print(sum(enemy_life))
    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()))

h_sorted = sorted(h)
print(sum(h_sorted[:-k]))

Failing test case input:
3 0
1100000011 1010100000 1110000000

Expected output:
3220100011


Actual output:
0


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

h_sorted = sorted(h)

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

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

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())
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):
eneNum, spNum = map(int, input().split())
eneHp = map(int, input().split())
eneHpList = list(eneHp)









eneHpList.reverse()
del eneHpList[0:min([spNum, len(eneHpList)])]
count = sum(eneHpList)

print("{}".format(count))

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

Expected output:
10


Actual output:
35


Fixed submission (verdict: Accepted):
eneNum, spNum = map(int, input().split())
eneHp = map(int, input().split())
eneHpList = list(eneHp)









eneHpList.sort()
eneHpList.reverse()
del eneHpList[0:min([spNum, len(eneHpList)])]
count = sum(eneHpList)

print("{}".format(count))

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

A_list = list(A)
counter = 0
A_list.sort()
A_list.reverse()

if K >= N:
    print(N)
else:
    for val in range(N - K):
        counter += int(A_list[val+K])
    print(counter)

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

Expected output:
0


Actual output:
8


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

A_list = list(A)
counter = 0
A_list.sort()
A_list.reverse()

if K >= N:
    print(0)
else:
    for val in range(N - K):
        counter += int(A_list[val+K])
    print(counter)

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

Failing test case input:
3 0
0000000000 1100000000 0110000000

Expected output:
1210000000


Actual output:
0


Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
print(sum(h[:n-k]) if n>k else 0)
Problem: p02785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,K=map(int,input().split())
List=list(map(int,input().split()))
S=sorted(List)
if K==0:
    i=1
else:
    i=0
del S[i:K+1]
print(sum(S))

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

Expected output:
23


Actual output:
49


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
List=list(map(int,input().split()))
S=sorted(List)[::-1]

del S[0:K]
print(sum(S))

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

import heapq

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = list(map(lambda x: x*(-1), H))
heapq.heapify(H)

if K >= N:
    print(0)
else:
    for _ in range(K):
        heapq.heappop(H)
        break
    print(-sum(H))

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

Expected output:
25


Actual output:
34


Fixed submission (verdict: Accepted):

import heapq

N, K = map(int, input().split())
H = list(map(int, input().split()))
H = list(map(lambda x: x*(-1), H))
heapq.heapify(H)

if K >= N:
    print(0)
else:
    for _ in range(K):
        heapq.heappop(H)
    print(-sum(H))

Problem: p02785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k=map(int,input().split())
if(n<=k):
  print(0)
  exit()

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

Failing test case input:
3 1
1000001100 1000010000 1000000000

Expected output:
2000001100


Actual output:
1000000000


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
if(n<=k):
  print(0)
  exit()

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

Problem: p02785
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k=map(int,input().split(' '))
l=list(map(int, input().split(' ')))
l=sorted(l)

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=sorted(l)
 
print(sum(l[:max(n-k,0)]))

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

import sys


def solve(N: int, K: int, H: "List[int]"):
    H.reverse()
    return sum(h for h in H[K:])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    print(solve(N, K, H))

if __name__ == '__main__':
    main()


Failing test case input:
3 1
1000001100 1000010000 1000000000

Expected output:
2000001100


Actual output:
2000011100


Fixed submission (verdict: Accepted):

import sys


def solve(N: int, K: int, H: "List[int]"):
    H.sort()
    H.reverse()
    return sum(h for h in H[K:])


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    K = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    print(solve(N, K, H))

if __name__ == '__main__':
    main()