Problem: p02628
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=input().split()
N=int(N)
K=int(K)
a=[]
a=[int(a) for a in input().split()]
a.sort()
print(sum(a[0:K-1]))

Failing test case input:
5 3
38 100 80 16 150

Expected output:
134


Actual output:
54


Fixed submission (verdict: Accepted):
N,K=input().split()
N=int(N)
K=int(K)
a=[]
a=[int(a) for a in input().split()]
a.sort()
print(sum(a[0:K]))

Problem: p02628
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
L=map(int,input().split())

L_2=sorted(L)

L_3=L_2[0:k]
print(L_3)
print(sum(L_3))

Failing test case input:
3 3
83 011 89 120 145

Expected output:
183


Actual output:
[11, 83, 89]
183


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

L_2=sorted(L)

L_3=L_2[0:k]
print(sum(L_3))

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

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

p = sorted(p)

print(p)

ans = 0
for i in range(K):
    ans += p[i]

print(ans)

Failing test case input:
8 3
28 010 20 173 80

Expected output:
58


Actual output:
[10, 20, 28, 80, 173]
58


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

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

p = sorted(p)


ans = 0
for i in range(K):
    ans += p[i]

print(ans)

Problem: p02628
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int,input().split())
List_1 = sorted(list(map(int, input().split())), reverse=True)
K = K+1
ans = sum(List_1[:K])
print(ans)

Failing test case input:
3 4
158 000 113 -1 126

Expected output:
238


Actual output:
396


Fixed submission (verdict: Accepted):
N, K = map(int,input().split())
List_1 = sorted(list(map(int, input().split())))
ans = sum(List_1[:K])
print(ans)

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

n = 0
for i in range(b):
  n += i
  
print(n)

Failing test case input:
2 4
49 100 4 -2 126

Expected output:
151


Actual output:
6


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

n = 0
for i in range(b):
  n += c[i]
  
print(n)

Problem: p02628
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int,input().split())
List_1 = sorted(list(map(int, input().split())), reverse=True)
K = K+1
ans = sum(List_1[:K])

Failing test case input:
-1 4
3 000 10 17 319

Expected output:
30


Actual output:

Fixed submission (verdict: Accepted):
N, K = map(int,input().split())
List_1 = sorted(list(map(int, input().split())))
ans = sum(List_1[:K])
print(ans)

Problem: p02628
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, k = map(int, input().split())
p = list(map(int,input().split()))

ans = 0

for i in range(k):
    ans += p[i]

print(ans)

Failing test case input:
5 3
82 011 41 120 80

Expected output:
132


Actual output:
134


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

p = sorted(p)

ans = 0

for i in range(k):
    ans += p[i]

print(ans)