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):
a=input();print(sum(list(map(int,input().split()))[:int(a[2])]))

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

B.sort()
num = 0

for i in range(A2):
  num = B[i]

print(num)



A1, A2 = map(int, input().split())
B = list(map(int,input().split()))	

B.sort()
num = 0

for i in range(A2):
  num = num + B[i]
  
print(num)

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())))
a = 0
for i in range(k):
  a += i
print(a)
  


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


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

N,K = tuple(map(int,input().split(" ")))
cont = sorted(list(map(int,input().split(" "))))
print(sum(cont[: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())
price = list(map(int, input().split()))
price = sorted(price)
sum(price[:k])

n, k = map(int, input().split())
price = list(map(int, input().split()))
price = sorted(price)
print(sum(price[: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()
sum = 0
for i in range(K):
    print(i)
    sum = sum + p[i]
print(sum)


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


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):
l = input().split()
n1 = int(l[0])
n2 = int(l[1])

money = input().split()

for i in range(n1):
    money[i] = int(money[i])

money.sort()
print(money)

ans = 0

for i in range(n2):
    ans += money[i]

print(ans)

l = input().split()
n1 = int(l[0])
n2 = int(l[1])

money = input().split()

for i in range(n1):
    money[i] = int(money[i])

money.sort()

ans = 0

for i in range(n2):
    ans += money[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(p)
price=0
for idx in range(K):
    price=price+p[idx]
print(price)

N,K=map(int,input().split())
p = list(map(int,input().split()))
p=p.sort()
price=0
for idx in range(K):
  price=price+p[idx]
print(price)

N,K=map(int,input().split())
p=list(map(int, input().split()))
p.sort()
print(p)
price=0
for idx in range(K):
    price=price+p[idx]
print(price)

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

price=0
for idx in range(K):
    price=price+p[idx]
print(price)


Verdicts: Wrong Answer

Runtime Error

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

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

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

p.sort()
ans = 0
for i in range(k):
  ans += p[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 = input().split()

P = [int(p) for p in input().split()]

P.sort()

for q in range(int(K)):
    X = X + int(q)

print(X)

N,K = input().split()

P = [int(p) for p in input().split()]

P.sort()

X = 0

for q in range(int(K)):
    X = X + P[q]

print(X)

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


n, k = list(map(int, input().split()))
price_arr = list(map(int, input().split()))
price_arr.sort()
sum = 0
for i in range(0,k):
  sum += price_arr[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(int,input().split())
B=0
p.sort()
K=K-1
for i in range(0,K):
    B=B+p[i]
    i=i+1
    
print(B)

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


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


Verdicts: Runtime Error

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())
print('0'if n%k==0 else'1')

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 = input().split()
n = int(n)
k = int(k)
listnum = []
newlist = []
sumnum = 0
for a in range(n):
    listnum.append(int(input())
newlist = sorted(listnum)
for b in range(k):
    sumnum = sumnum + list[0]
print(sumnum)

n, k = input().split()
n = int(n)
k = int(k)
listnum = input().split()
newlist = []
sumnum = 0

listnum = [int(n) for n in listnum]
newlist = sorted(listnum)
for b in range(k):
    sumnum = sumnum + newlist[b]
print(sumnum)

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

n, k = list(map(int, input().split()))
values = list(map(int, input().split()))
print(sum(sorted(values)[: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()))
ppp=sorted(p)
print(ppp)
buy=[]
for i in range(K):
    buy.append(ppp[i])
print(sum(buy))

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

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=[int(v) for v in input().split()]
print(sum(a[:k]))

n,k=map(int,input().split())
a=[int(v) for v in input().split()]
a.sort()
print(sum(a[: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):
def main():
  N, K = list(map(int, input().split()))
  P = list(map(int, input().split()))

  min_ = float('inf')

  all_ = list(range(N))
  for items in itertools.combinations(all_, K):
    sum_ = sum([P[i] for i in items])
    min_ = min(min_, sum_)

  print(min_)


if(__name__ == '__main__'):
  main()

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

  P.sort()
  print(sum(P[:K]))


if(__name__ == '__main__'):
  main()

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

list_p.sort()

sum(list_p[:k])

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

list_p.sort()

print(sum(list_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())
prices = list(map(input().split()))
print(sum(sorted(prices[:k])))

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

N = a[0]
K = a[1]

p = p.sort

g = sum(p[0:K-1])
print(g)

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

p = p.sort

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

print(K)

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

N = a[0]
K = a[1]

p.sort()

g = 0
for k in range(K)
	g = g+p[k]
print(g)

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

N = a[0]
K = a[1]

p.sort()

g = sum(p[0:K-1])
print(g)

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

N = a[0]
K = a[1]

p = p.sort

g = 0
for i in range(K):
    g = K+p(i)

print(g)

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

N = a[0]
K = a[1]

p.sort()

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

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

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

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


n, k = list(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())
List_1 = sorted(list(map(int, input().split())), reverse=True)
K = K+1
ans = sum(List_1[:K])

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)

N, K = map(int,input().split())
LIst_1 = sorted(list(map(int, input().split())), reverse=True)
K = K+1
ans = sum(List_1[:K])

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

Verdicts: Wrong Answer

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

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

n,k = list(map(int, input().split()))
p = list(map(int, 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):
k = input()
n = input()
price = list(input().split()).sort

total = sum(prices[:n])
print(total)

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


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

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())
li = [int(i) for i in input().split()]
newlist = sorted(li)
price = 0
for a in range(k):
  count += newlist[a]
  
print(count)

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

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()
ans = sum(p[:k])
print(ans)

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

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

prices = sorted(prices)

print(sum(prices[:k])

n, k = list(map(int, input().split()))
prices = list(map(int, input().split()))
prices = sorted(prices)
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):
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)

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)

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)
ans = 0

for a in p[:K]:
    ans += a
    print(a)

print(ans)


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

p = sorted(p)
ans = 0

for a in p[:K]:
    ans += a
    #print(a)

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

que = input()

que = [x for x in que.split()]
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.

Author : Takeshi Saga

"""

import itertools
import numpy as np

N, K = input()
que = input()
try:
    N = int(N)
except:
    pass
try:
    K = int(K)
except:
    pass



que = [int(x) for x in que.split()]

#print(que)
"""
tmp = []
for x in que:
    for xx in range(K):
        tmp.append(x)
que = tmp
"""
min_val = 999999999

for x in itertools.combinations(que, K):
    tmp = np.sum(x)
    if tmp < min_val:
        min_val = tmp

print(min_val)

import itertools
import numpy as np

N, K = input()
que = input()
try:
    N = int(N)
except:
    pass
try:
    K = int(K)
except:
    pass



que = [int(x) for x in que.split()]

#print(que)
"""
tmp = []
for x in que:
    for xx in range(K):
        tmp.append(x)
que = tmp
"""
min_val = 999999999

for x in itertools.combinations(que, K):
    tmp = np.sum(x)
    if tmp < min_val:
        min_val = tmp

print(min_val)


# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.

Author : Takeshi Saga

"""

import itertools
import numpy as np

tmp = input()
N,K = tmp.split()
que = input()
try:
    N = int(N)
except:
    pass
try:
    K = int(K)
except:
    pass



que = [int(x) for x in que.split()]

#print(que)
"""
tmp = []
for x in que:
    for xx in range(K):
        tmp.append(x)
que = tmp
"""
min_val = 999999999

que = sorted(que)

#for x in itertools.combinations(que, K):

x = [que[i] for i in range(K)]
tmp = np.sum(x)

print(min_val)

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.

Author : Takeshi Saga

"""

import itertools
import numpy as np

tmp = input()
N,K = tmp.split()
que = input()
try:
    N = int(N)
except:
    pass
try:
    K = int(K)
except:
    pass



que = [int(x) for x in que.split()]

#print(que)
"""
tmp = []
for x in que:
    for xx in range(K):
        tmp.append(x)
que = tmp
"""
min_val = 999999999

que = sorted(que)

#for x in itertools.combinations(que, K):
for x in que:
    tmp = np.sum(x)
    if tmp < min_val:
        min_val = tmp

print(min_val)

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.

Author : Takeshi Saga

"""

import itertools
import numpy as np

tmp = input()
#tmp = "5 3"
N,K = tmp.split()
que = input()

try:
    N = int(N)
except:
    pass
try:
    K = int(K)
except:
    pass



que = [int(x) for x in que.split()]

#print(que)
"""
tmp = []
for x in que:
    for xx in range(K):
        tmp.append(x)
que = tmp
"""
min_val = 999999999

que = sorted(que)

#for x in itertools.combinations(que, K):

x = [que[i] for i in range(K)]
min_val = np.sum(x)

print(min_val)

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,m=map(int, input().split())
l=list(map(int, input().split()))
ans=0
l.sort()
for i in range(k):
    ans=ans+l[k]
print(ans)

n,m=map(int, input().split())
l=list(map(int, input().split()))
ans=0
l.sort()
for i in range(m):
    ans=ans+l[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()))
p.sort()
for i,v in enumerate(p):
    ans += v
    if i == 2:
        print(ans)
        exit()
print(ans)

N,K = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
ans = 0
for i,v in enumerate(p):
    ans += v
    if i == K - 1:
        print(ans)
        exit()
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())
ans=0
p=list(map(int,input().split()))

p.sort()

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

    print(ans)


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

p.sort()

for i in range(K):
    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().split())
p = list(map(int,input().split()))
p.sort()
ans = 0
for i in range(K):
  ans += p[i]
print(ans)

n,k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ans = 0
for i in range(k):
  ans += p[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):
number = input().split(" ")
N = int(number[0])
K = int(number[1])

numbers = input().split(" ")
numbers.sotr()

a = 0

for i in range(K):
	a += numbers[i]
print(a)

number = input().split(" ")
N = int(number[0])
K = int(number[1])
 
list = []
numbers = input().split(" ")
for i in numbers:
    list.append(int(i))
list.sort()
 
a = 0
 
for i in range(K):
	a += int(list[i])
print(a)

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 = list(map(int, input().split())).sort()
res = 0
for x in range(K):
  res += p[x]
print(res)

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

N, K = input().split()
p = sorted([list(map(int, input().split()))])
res = 0
for x in range(K):
  res += p[x]
print(res)

from functools import reduce

N, K = [int(x) for x in input().split()]
p = sorted([int(x) for x in input().split()])
print(reduce(lambda x, y: x + y, p[0:K]))

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):
def main():
  n, k = map(int, input().split())
  p = sorted(list(input().split()))
  
  hui = 0
  
  for i in range(k):
    hui += int(p[i])
    
  print(int(hui))
  
main()

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

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


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,*P=map(int,open(0).read().split())
print(sum(sorted(P[: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):
n,k=map(int,input().split())
P=list(map(int,input().split()))
P.sort()
print(sum(P[0:k+1]))


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

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

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 = list(int(t) for t in input().split())
price = list(int(t) for t in input().split())
price.sort()
total = sum(price[0,K])
print(total)

N,K = input().split()
price = list(int(t) for t in input().split())
price_s = sorted(price)
total = sum(price_s[0:int(K)])
print(total)

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

price = list(map(int,input(),split()))

price.sort()

for p in range(1,K):
	ans  += price[p]

print(ans)


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

price = list(map(int,input(),split()))

price.sort

for p in range(1,K):
	ans  += price[p]

print(ans)


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

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

price.sort()

ans = sum(price[:K])
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())
p = list(map(int, input().split()))

p.sort(reverse=True)

i = 0
while i < k:
  i += p[i]
  i ++
  
print(i)

n, k = map(int, input().split())
p = list(map(int, input().split()))
 
p.sort()
 
i = 0
price = 0
while i < k:
  price += p[i]
  i ++
  
print(price)

n, k = map(int, input().split())
p = list(map(int, input().split()))
 
p.sort()
 
i = 0
while i < k:
  i += p[i]
  i ++
  
print(i)

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

i = 0
price = 0
while i < k:
  price += p[i]
  i += 1
 
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(" "))
p = list(map(int,input().split(" "))).sort()
ans = 0

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

print(ans)

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

p.sort()
#print(p)

ans = 0
for i in range(k):
    ans = ans + p[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(' '))
fruit_prices = list(map(int, input().split(' ')))
print("{0}個の果物から{1}種類選ぶ".format(N, K))
print(fruit_prices)

fruit_prices.sort()
print(fruit_prices)

min_price = 0

for i in range(K):
  min_price += fruit_prices[i]

print(min_price)

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

fruit_prices.sort()

min_price = 0

for i in range(K):
  min_price += fruit_prices[i]

print(min_price)

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(sum(l[:k]))

n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort()
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):
n = int(input())
k = int(input())
i=0
p = []
while i < n:
    p.append(int(input()))
    i += 1

p.sort()
s= sum(p[:k])
print(s)

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

n = int(input())
k = int(input())
i=0
p = []
while i < n:
    p.append(int(input()))
    i += 1
#print(p)
#s=0
#l=0
#while l < k:

#    p = p.remove(min(p))
#    l += 1
#print(s)
p.sort()
s= sum(p[:k])
print(s)

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

n,k = map(int, input().split())
i=0
p = []
while i < n:
    p.append(int(input()))
    i += 1
#print(p)
#s=0
#l=0
#while l < k:

#    p = p.remove(min(p))
#    l += 1

p.sort()
s= sum(p[:k])
print(s)

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

Verdicts: 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):
a=int(100)
x=int(input())
i=0
for i in range(10000):
  if a < x:
    a*=1.01
    a=int(a)
    i+=1
  elif a>=x:
    break
print(i)


a=int(100)
x=int(input())
for i in range(10000):
  if a < x:
    a*=101//100
    a=int(a)
    i+=1
  else:
    break
print(i)


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: 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 = sorted([int(input()) for i in range(n)])
count=0
for i in range(k):
  count = count+p[i]
print(count)


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

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):
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
x = list(map(int, input()))
x.sorted()
o = 0
for i in range(b):
    o = O+x[i]
print(o)


# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
o = 0
for i in range(b):
    o = o+x[i]
print(o)


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 = [int(x) for x in input().split()]
s = 0
for i in range(k):
    s+=p[i]
print(s)


    

n,k = map(int,input().split())
p = [int(x) for x in 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):
n,k = map(int,input().split())
a = list(map(int,input().split()))
asr = sorted(a)
del asr[0:n-k]
ans = sum(asr)
print(str(ans))

n = int(input())
k = int(input())
a = list(map(int,input().split()))
asr = sorted(a)
del asr[0:n-k]
ans = sum(asr)
print(str(ans))

n,k = map(int,input().split())
a = list(map(int,input().split()))
asr = sorted(a,reverse=True)
del asr[0:n-k]
ans = sum(asr)
print(str(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()))
sum = 0
for i in range(N):
  sum += sorted(P)[i]
print(sum)

N,K = map(int,input().split())
P = list(map(int,input().split()))
sum,cnt = 0,0
for i in range(K):
  sum += sorted(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):
N,K = map(int,input().split())
p = list(map(int,input().split)
p.sort(reverse = True)
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(" ")

cost = input().split(" ")

cost.sort()

sum = 0
for i in range(int(k)):
  sum += int(cost[i])
print(sum)

n,k = input().split(" ")

cost = input().split(" ")
a = []
for i in cost:
  a.append(int(i))
a.sort()

sum = 0
for i in range(int(k)):
  sum += int(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 = input().strip().split()
n, k = [int(n), int(k)]

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

p.sort

print(f'{sum(p[0:k])}')

n, k = input().strip().split()
n, k = [int(n), int(k)]

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

p.sort()

print(f'{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 = list(map(int, input().split()))

price_list = input().split()

price_list.sort()

answer = 0

for i in range(K):
    answer += price_list[i]

print(answer)

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

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

price_list.sort()

answer = 0

for i in range(K):
    answer += price_list[i]

print(answer)

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

n,k = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
ans = 0
for i in range(k):
  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().split())
p = list[]
ans = 0

for i in range (n):
  p[i] = int(input())

p.sort()

for i in range(k):
  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

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

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

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

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()
res = 0
i = 0
while(K):
	res += P[i]
	K -= 1
print(res)


N,K = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
res = 0
i = 0
while(K):
    res += P[i]
    K -= 1
    i += 1
print(res)

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()))
l=[]

p.sort()

for i in range(K+1):
  l.append(p[i])
print(sum(l))



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

p.sort()

for i in range(K):
  l.append(p[i])
print(sum(l))

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

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

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(i) for i in input().strip().split(" ")]
arr=[int(i) for i in input().strip().split(" ")]
arr=sorted(arr)
ans=0
for i in range(k):
    ans+=arr[k]
print(ans)

n,k=[int(i) for i in input().strip().split(" ")]
arr=[int(i) for i in input().strip().split(" ")]
arrs=sorted(arr)
print(arrs)
ans=0
for i in range(k):
    ans+=arrs[k]
print(ans)

n,k=[int(i) for i in input().strip().split(" ")]
arr=[int(i) for i in input().strip().split(" ")] 
ans=0
arr=sorted(arr)
for i in range(k):
    ans+=arr[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(p[:k]))

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

n=int(input())
k=int(input())
a = [int(input()) for i in range(n)]
a.sort()
print(sum(a[:k]))

n=int(input())
k=int(input())
a = [int(input()) for i in range(n)]
a.sort()
print(sum(a[:k]))

n=input()
k=input()
a = [int(input()) for i in range(int(n))]
a.sort()
print(sum(a[:int(k)]))

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

Verdicts: 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):
def resolve():
    n,k = map(int, input().split())
    listA = list(map(int,input().split()))
    listA.sort()
    c = sum(listA[:k])
    print(c
resolve()

def resolve():
    n,k = map(int, input().split())
    listA = list(map(int,input().split()))
    listA.sort()
    c = sum(listA[:k])
    print(c)
    
resolve()

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

print(sum(p))

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

print(sum(p[:K]))

Verdicts: Wrong Answer

Accepted