TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
fruits = list(map(int, input().split()))

mix = []

for mix in range(k):
    mix.append(min(fruits))
    fruits.remove(min(fruits))

print(sum(mix))

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

mix = []
a = 0

while a < k:
    mix.append(min(fruits))
    fruits.remove(min(fruits))
    a += 1

print(sum(mix))

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
(N, K) = input().split(' ')
a = input().split(' ')
a.sort()
x = 0
print(a)
for i in range(int(K)):
    x += int(a[i])
print(x)

(N, K) = input().split(' ')
a = list(map(int, input().split()))
a.sort()
x = 0
for i in range(int(K)):
    x += int(a[i])
print(x)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
plist = list(map(int, input().split()))

plist.sort()
ans = sum(plist, k)

print(ans)

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

plist.sort()
ans = 0
for i in rangr(k):
    ans += plist[i]

print(ans)


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

plist.sort()
ans = 0
for i in range(k):
    ans += plist[i]

print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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

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

total=0

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

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

p=list(map(int,input().split()))
p.sort()
total=0

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

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
Pn = list(map(int, input().split()))

Pn.sort()
sum = 0
for i in range(K):
	sum += Pn[K]

print(sum)

N, K = map(int, input().split())
Pn = []
for i in range(N):
	Pn.append(input())

Pn.sort()
sum = 0
for i in range(K):
	sum += Pn[K]

print(sum)

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

Pn.sort()
s = 0
for i in range(K):
	s += Pn[K]

print(s)

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

P.sort()
s = 0
for i in range(K):
	s += P[i]

print(s)

N, K = map(int, input().split())
Pn = []
for i in range(N):
	Pn.append(input())

Qn = sorted(Pn)
sum = 0
for i in range(K):
	sum += Qn[K]

print(sum)

N = int(input())
K = int(input())
Pn = []
for i in range(N):
	Pn.append(input())

Qn = sorted(Pn)
sum = 0
for i in range(K):
	sum += Qn[K]

print(sum)

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

P.sort()
s = 0
for i in range(K):
	s += P[i]

print(s)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
P = map(int,input().split())
sum(sorted(P)[:K])

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

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n,k=map(int,input().split())
p=list(map(int,input().split()))
a=0
for i in range(k-1):
  a+=p[i]
print(a)

n,k=map(int,input().split())
p=list(map(int,input().split()))
p=sorted(p)
a=0
for i in range(k-1):
  a+=p[i]
print(a)

n,k=map(int,input().split())
p=list(map(int,input().split()))
p=sorted(p)
a=0
for i in range(k):
  a+=p[i]
print(a)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, m =map(int,input().split())
s = list(map(int,input().split()))
ans = 0
s = s.sort()
for _ in range(m):
  ans += s[_]
print(ans)

n, m =map(int,input().split())
s = list(map(int,input().split()))
ans = 0
s.sort()
for _ in range(m):
  ans += s[_]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n , x = map(int,input().split())
price_list = list(map(int,input().split()))
ld = sorted(price_list, reverse=True)
sum = 0
for i in range(x):
  sum += ld[i]
print(sum)

n , x = map(int,input().split())
price_list = list(map(int,input().split()))
ld = sorted(price_list, reverse=False)
sum = 0
for i in range(x):
  sum += ld[i]
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
sum(p[:k])

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

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for p in range(k):
  price += p[k]
  
print(price)

n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for p in range(k):
  price += p[k]
 
print(price)

n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
for i in range(k):
  price += p[i]
print(price)

n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K = map(int,input().split())
a = input().split()
a = [int(i) for i in a]
la = sorted(a)
sum(la[:K])

N,K = map(int,input().split())
a = input().split()
a = [int(i) for i in a]
la = sorted(a)
print(sum(la[:K]))

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse = True)
min = 0

for i in range(K):
  min += A[i]
  
print(min)

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

A.sort()
min = 0

for i in range(K):
  min += A[i]
  
print(min)


Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
d=0
for i in range(b):
  d=d+c[i]
print(d)

a,b=input().split()
a=int(a)
b=int(b)
c=list(map(int,input().split()))
d=0
c.sort()
for i in range(b):
  d=d+c[i]
print(d)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import numpy as np
s = list(map(int,input().split()))
n=s[0]
k=s[1]
s = list(map(int, input().split()))
s.sort()
print(s)
s=np.array(s[0:k])
print(np.sum(s))



import numpy as np
s = list(map(int,input().split()))
n=s[0]
k=s[1]
s = list(map(int, input().split()))
s.sort()
print(s)
s=np.array(s[0:k])
print(np.sum(s))



import numpy as np
s = list(map(int,input().split()))
n=s[0]
k=s[1]
s = list(map(int, input().split()))
s.sort()
s=np.array(s[0:k])
print(np.sum(s))



Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
A = list(map(int, input().split()))
result = 0
for i in range(N):
    for j in range(i):
        if A[i-j-1] > A[i-j]:
            tmp = A[i-j]
            A[i-j] = A[i-j-1]
            A[i-j-1] = tmp
        print(A)

for i in range(K):
    result += A[i]

print(result)



#!/usr/bin/env python
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
A = list(map(int, input().split()))
result = 0
for i in range(N):
    for j in range(i):
        if A[i-j-1] > A[i-j]:
            tmp = A[i-j]
            A[i-j] = A[i-j-1]
            A[i-j-1] = tmp

for i in range(K):
    result += A[i]

print(result)



Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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

n,k,*p=map(int,open(0).read().split());print(sum(sorted(p)[:k]))

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
a = input() # 5 3
b = input() # 50 100 80 120 80
c = a.split() 
d = b.split()
e = sorted(d) # 50 80 80 100 120
f = int(c[1])
for i in range(f):
  print(e[i])

a,b = map(int,input().split())
price = [int(s) for s in input().split()]
pric = sorted(price)
sum = 0
for i in range(b):
    sum += int(pric[i])
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K = map(int, input().split())
p=sorted(list(map(int,input().split())))
print(sum(p[0:2]))

N,K = map(int, input().split())
p=sorted(list(map(int,input().split())))
print(sum(p[0:K]))

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n,k = map(int, input().split())
l = list(map(int, input().split()))
l1 = sorted(l, reverse= False)
sum = sum(l[0:3])
print(sum)

n,k = map(int, input().split())
l = list(map(int, input().split()))
l1 = sorted(l, reverse= False)
sum = sum(l1[0:k])
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import sys
def order (p):
    return (sorted(p))         
def Mix_Juice (p):
    p[0] = len (p)
    p[1] = K
    a = order (p[2:p[0]])
    b = 0
    for i in range (0, K-1):
        b = b + a[i]
    return b
p = list(map(int, input().split()))
Mix_Juice (p)

import sys
def order (p):
    return (sorted(p))         
def Mix_Juice (p):
    p[1] = K
    a = order (p[2:])
    b = 0
    for i in range (0, K):
        b = b + a[i]
    return b
p = list(map(int, input().split()))
Mix_Juice (p)

n = input()
m = n.split()
a = [input() for l in range(0,1)]
b = a[0].split()

for i in range(0, len(b)):
    b[i] = int(b[i])

c = sorted(b, reverse=True)
p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])


import sys
def order (p):
    return (sorted(p))         
def Mix_Juice (p, K):
    N = len (p)
    a = order (p)
    b = 0
    for i in range (0, K):
        b = b + a[i]
    return b
N,K = map(int, input().split())
p = list(map(int, input().split()))
Mix_Juice (p,K)

n = input()
m = n.split()

a = [input() for l in range(0,1)]
b = a[0].split()


for i in range(0, len(b)):
    b[i] = int(b[i])

c = sorted(b, reverse=True)

p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])
print(int(p))

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K=map(int,input().split())
A=map(int,input().split())
AA=list(A)
list.sort(AA,reverse=False)
print(AA)
ans=int(0)
for i in range(K):
    ans += AA[i]
print(ans)


N, K=map(int,input().split())
A=map(int,input().split())
AA=list(A)
list.sort(AA,reverse=False)
ans=int(0)
for i in range(K):
    ans += AA[i]
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
print(sum(p[:K]

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

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int,input().split())
p = map(int,input().split())
newlist = sorted(p, reverse=False)
ans_list=[]
for i in range(1,K+1):
    ans.append(newlist[i-1])
print(sum(ans_list))


N, K = map(int,input().split())
p = map(int,input().split())
newlist = sorted(p, reverse=False)
ans_list=[]
for i in range(1,K+1):
    ans_list.append(newlist[i-1])
print(sum(ans_list))


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
P = list(map(int, input().split())).sort()
print(sum(P[:K]))


N, K = map(int, input().split())
P = sorted(list(map(int, input().split())))
print(sum(P[:K]))

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
li = list(input().split())

new_list = sorted(li)

j = 0
i = 0

while i <= k-1:
  j += int(new_list[i])
  i += 1

print(j)

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

li.sort(key = int)

print(li)

j = 0
i = 0

while i <= k-1:
  
  j += int(li[i])
  i += 1

print(j)

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

li.sort(key = int)

j = 0
i = 0

while i <= k-1:
  
  j += int(li[i])
  i += 1

print(j)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
p = sorted(list(map(int, ipupt().split())))
print(sum(p[:k]))


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


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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

x = list(input().split()) for i in range(n)
x.sort()
print(sum(list[0:k]))

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

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

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n,k = map(int,input().split())
a = list(map(int,input().split()))
list.sort(a)
sum(a[0:k])

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

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n,k=int(input())
list=list(map(int,input().split()))
list.sort()
ans=0
for i in range(k):
  ans+=list[i]
print(ans)

n,k=map(int,input().split())
list=list(map(int,input().split()))
list.sort()
ans=0
for i in range(k):
  ans+=list[i]
print(ans)

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(p)[:2]))

N, K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(p)[:K]))

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
p = list(map(int, input().split()))

p = sorted(p, reverse=True)
ans = 0
for k in range(K):
  ans += p[k]

N, K = map(int, input().split())
p = list(map(int, input().split()))
p = sorted(p, reverse=True)

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

print(ans)

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)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K=map(int,input().split())
price=list(map(int,input().split()))
price.sort()
price_K=price[:K]
j=0
for i in price_K:
  j+=i
  print(j)

N,K=map(int,input().split())
price=list(map(int,input().split()))
price.sort(reverse=True)
price_N=price[:K]
j=0
for i in price_K:
	j+=i
print(j)

N,K=map(int,input().split())
price=list(map(int,input().split()))
price.sort()
price_K=price[:K]
j=0
for i in price_K:
  j+=i
print(j)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
a=input()
b=a.split()
c=input()
d=c.split()
N=int(b[0])
K=int(b[1])
p=[]
for i in range(N):
    p.append(int(d[i]))
p.sort()
print(p)
ans=0
for i in range(K):
    ans=ans+p[i]
print(ans)

a=input()
b=a.split()
c=input()
d=c.split()
N=int(b[0])
K=int(b[1])
p=[]
for i in range(len(d)):
    p.append(int(d[i]))
p.sort()
ans=0
for i in range(K):
    ans=ans+p[i]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input())
l = sorted([int(x) for x in input().split()])

print(sum(l[:k]))

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

print(sum(l[:k]))

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):

import sys
import math
input = sys.stdin.readline

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


n, k = inlt()
p = inlt()
p = math.sort(p)
print(sum(p[:k]))





import sys
input = sys.stdin.readline

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


n, k = inlt()
p = inlt()
p = sorted(p)
print(sum(p[:k]))




Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split(" "))
p = list(map(int, input().split(" ")))

sort(p)
print(sum(p[:K]))

         
           

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

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = input().split()
p = [int(i) for i in input().split()]
p.sort()
print(sum(p[:K+1]))


a = input()
print("A" if ord(a) < 92 else "a") 



N, K = map(int,input().split())
p = [int(i) for i in input().split()]
p.sort()
print(sum(p[:K]))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
P = list(map(int, input().split()))
P.sort()
sum(P[:K])

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

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K=(int(x) for x in input().split())
p=list(map(int, input().split()))
ld = sorted(p, reverse=True)
l=(ld[:K])
print(sum(l))

N,K=(int(x) for x in input().split())
p=list(map(int, input().split()))
ld = sorted(p)
l=(ld[:K])
print(sum(l))


Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
p - list(map(int, input().split()))

p = sorted(p, key = int)
print(sum(p[:2]))

n, k = map(int, input().split())
p = list(map(int,input().split()))
p = sorted(p, key = int)
print(sum(p[:k]))


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ls = []
for i in range(K):
    ls.append(p[i])


N, K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ls = []
for i in range(K):
    ls.append(p[i])
print(ls)

N, K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ls = []
for i in range(K):
    ls.append(p[i])
print(sum(ls))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K=map(int,input().split())
p = list(map(int,input().split()))
ans = 0

p.sort()
for i in range(1,K+1):
  ans += p[i]
print(ans)

N,K=map(int,input().split())
p = list(map(int,input().split()))
ans = 0

p.sort()
for i in range(K+1):
  ans += p[i]
print(ans)

N,K=map(int,input().split())
p = list(map(int,input().split()))
ans = 0

p.sort()
for i in range(K):
  ans += p[i]
print(ans)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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


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


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import sys
import numpy as np
from math import ceil as C, floor as F
from collections import defaultdict as D
from functools import reduce as R

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def _Ss(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Ss(): return _Ss(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

N, K = I()
print(N, K)
xs = sorted(Is())
print(np.sum(xs[:K]))

import sys
import numpy as np
from math import ceil as C, floor as F
from collections import defaultdict as D
from functools import reduce as R

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def _Ss(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Ss(): return _Ss(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

N, K = I()
xs = sorted(Is())
print(np.sum(xs[:K]))

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = int(input()), int(input())
P = [int(v) for v in input().split()]

print(sum(sorted(P)[:K]))

N, K = [int(v) for v in input().split()]
P = [int(v) for v in input().split()]

print(sum(sorted(P)[:K]))

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):

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

p.sort()

s = 0

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

print(s)


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

p.sort()

s = 0

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

print(s)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import sys
nsel = int(input().split()[1])
fruits = [int(fr) for fr in input().split()]
for fr in sorted(fruits)[:nsel]: sys.stdout.write(str(fr)+" ")

nsel = int(input().split()[1])
fruits = [int(fr) for fr in input().split()]
print(sum(sorted(fruits)[:nsel]))

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N,K=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
print(l)
print(sum(l[0:K]))


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


Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
num, select = map(int, input())
l = list(map(int, input()))

sum = 0
l = l.sort()
for i in l:
  sum += l[i]

print(sum)

N_syu, K_ko = map(int, input().split())
prices = list(map(int, input().split()))

prices.sort()

sum = 0
for i in range(K_ko):
    sum += prices[i]
print(sum)


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
p_list=sorted(list(map(int, input().split())))

print(p_list[:K])




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

print(sum(p_list[:K]))





Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
x = input()
arr = [int(j) for j in x.split()]
y = input()
main = [int(i) for i in y.split()]
main = sorted(main)
sum = 0
r = 0
while r < arr[1]:
  sum+=main[r]
  r+=1
print(main)


x = input()
arr = [int(j) for j in x.split()]
y = input()
main = [int(i) for i in y.split()]
main = sorted(main)
sum = 0
r = 0
while r < arr[1]:
  sum+=main[r]
  r+=1
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
def num2alpha(num):
    if num<=26:
        return chr(97+num)
    elif num%26==0:
        return num2alpha(num//26-1)+chr(90)
    else:
        return num2alpha(num//26)+chr(97+num%26)

if __name__ == '__main__':
  n = int(input())
  print(num2alpha(n))

no, sct = map(int, input().split(' '))
flut = list(map(int, input().split(' ')))
flut = sorted(flut, reverse=False)
sum_ = 0
for i in range(sct):
  sum_ += flut[i]
print(sum_)

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]
a = [int(i) for i in input().split()]
sorted(a)
sum = 0
for i in range(m):
  sum += a[i]
print(sum)


nm = [int(i) for i in input().split()]
n = nm[0]
m = nm[1]
a = [int(i) for i in input().split()]
a = sorted(a)
sum = 0
for i in range(m):
  sum += a[i]
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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

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

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
price_list = list(map(int, input().split()))

price_list.sort()

print(price_list)
print(sum(price_list[:k]))


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

price_list.sort()

print(sum(price_list[:k]))


Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n, k = map(int, input().split())
p = sorted(list(int(input()) for _ in range(n)))
print(sum(p[0:k]))

n, k = map(int, input().split())
p = sorted(list(map(int, input().split())))
print(sum(p[0:k]))


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
K=int(input())
N=int(input())
li=[]
for i in range(0,K):
  fruit=int(input())
  li.append(fruit)
  li.sort()
  sum1=0
  for i in range(0,N):
    sum1=sum1+li[i]
  print(sum1) 

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

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n,k = map(int, input().split())
p = list(map(int, input().split()))

print(sum(sorted(p)[:n]))

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

print(sum(sorted(p)[:N]))

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

print(sum(sorted(p)[:n+1]))


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

print(sum(sorted(p)[:N]))

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

print(sum(sorted(pi)[:N]))

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

print(sum(sorted(p_list)[:N]))

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

print(sum(sorted(p)[:N]))

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

print(sum(sorted(p)[:N]))

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

print(sum(sorted(p)[:N]))

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

print(sum(sorted(p)[:N]))

N,K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(p)[:N]))

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

print(sum(sorted(p)[:k]))


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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

n,k=map(int,input().split())
p=list(map(int,input().split()))
p2=sorted(p)
print(sum(p2[:k]))


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

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

n,k = map(input().split())
p = map(input)
print(sum(p,:k)

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

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


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


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


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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):

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

p.sort()
print(p[:k])



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

p.sort()

print(sum(p[:k]))


Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
a,b = map(int,input().split())
mylist = input().split()
mylist.sort()
c = 0
print(mylist)
for i in range(b-1):
    c = c + int(mylist[i-1])
print(c)

a, b = map(int,input().split())
c = input().split()
c.sort()
d = 0
for i in range(b):
	d += int(c[i])
print(d)

a, b = list(map(int, input().split()))
s = input().split()
c = 0
s.sort()
for i in range(b):
    c += int(s[i])
print(c)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
N, K = map(int, input().split())
prices = [int(i) for i in input().split()]
print(sum(prices.sort()[:K]))

N, K = map(int, input().split())
prices = [int(i) for i in input().split()]
prices.sort()
print(sum(prices[:K]))


Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
n,k = map(int,input().split())
p = list(input().split())
p = [int(x) for x in p]
p.sort()
print(p)
ans =sum(p[0:k])
print(ans)

n,k = map(int,input().split())
p = list(input().split())
p = [int(x) for x in p]
p.sort()
ans =sum(p[0:k])
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import numpy as np
n, k = list(map(int, input().rstrip().split()))
p = list(map(int, input().rstrip().splist()))
p = np.sort(np.array(p))

print(np.sum(p[:k]))

import numpy as np
n, k = list(map(int, input().rstrip().split()))
p = list(map(int, input().rstrip().split()))
p = np.sort(np.array(p))
 
print(np.sum(p[:k]))

Verdicts: Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
k_n = list(map(int, input().split()))
p = list(map(int, input().split()))
p = sorted(p, reverse=False)
sum = 0
for i in range(k_n[0]):
    sum += p[i]
print(sum)

k_n = list(map(int, input().split()))
p = list(map(int, input().split()))
p = sorted(p, reverse=False)
sum = 0
for i in range(k_n[1]):
    sum += p[i]
print(sum)

Verdicts: Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import heapq
N,K = map(int,input().split())
p = list(map(int,input().split()))
sum(heapq.nsmallest(K,p))

import heapq
N,K = map(int,input().split())
p = list(map(int,input().split()))
sum(heapq.nsmallest(K,p))

import heapq
N,K = map(int,input().split())
p = list(map(int,input().split()))
print(sum(heapq.nsmallest(K,p)))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import functools
n,k=int(input())
p=list(map(int,input().split()))
p.sort()
cost=functools.reduce(lambda x,y:x+y,p[:k],0)
print(cost)

import functools
n,k=int(input())
p=list(map(int,input().split()))
p.sort()
for i in range(k):
  cost+=p[i]
print(cost)

import functools
n,k=map(int,input().split())
p=list(map(int,input().split()))
p.sort()
cost=functools.reduce(lambda x,y:x+y,p[:k],0)
print(cost)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A shop sells N kinds of fruits, Fruit 1, \ldots, N, at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)  Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.

Submission attempts (in order):
import math 
n = int(input())
print(math.ceil(n/ 1000) * 1000 - n)

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

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

print(ans)


Verdicts: Runtime Error

Accepted