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

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

ps = p.sort()
ans = 0

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

print(ans)

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

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

p.sort()
ans = sum(p[0: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):
a = input().split(" ")
b = input().split(" ")
c = []
for i in b:
    c.append(i)
c.sort()
sum = 0
for i in c[0:int(a[1])]:
    sum += int(i)
print(sum)

a = input().split(" ")
b = input().split(" ").sort()
sum = 0
for i in a[1]:
    sum += i
print(sum)

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

c.sort()
sum = 0
for i in c[0:int(a[1])]:
    sum += int(i)
print(sum)

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

return sorted(fruit)[:K]

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

print(sum(sorted(fruits)[: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(N , K = map(int, input().split())
l = list(map(int, input().split()))
l = sorted(l)
res = 0
for i in range (K):
    res += l[i]
print(res)
            

N , K = map(int, input().split())
l = list(map(int, input().split()))
ll = sorted(l)
res = 0
if N == K :
    res = sum(ll)
elif K==1 : 
    res = ll[0]
else:
    for i in range (K):
        res += ll[i]
print(res)

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

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

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

N,K = map(int,input().split())
price = list(map(int,input().split()))
priceN = sorted(price)
total = 0
for i in range(K):
  total += priceN[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):
# encoding: utf-8
max_, request = map(int, input().split())
amounts = list(map(int, input().split()))
amounts.sort()
print(amounts[:request])

# coding: utf-8
max_, request = map(int, input().split())
amounts = list(map(int, input().split()))
amounts.sort()
print(sum(amounts[:request]))

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

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

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

print(ans)

n,k=map(int,input().split())
l=[int(_) for _ in input().split()]
l.sort()
 
ans=0
for i in range(k):
  ans+=l[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):
def main():
	N = int(input())
	K = int(input())

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

	part = price[0:K]

	print(sum(part))

if __name__ == '__main__':
    main()

def main():
  N = int(input())
  K = int(input())

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

  price.sort()

  part = price[0:K]

  print(sum(part))

if __name__ == '__main__':
  main()

def main():
	N = int(input())
	K = int(input())

	list = []

	for i in range(N):
		list.append(int(input()))
	
	list.sort()

	part = list[0:K]

	print(sum(part))

if __name__ == '__main__':
    main()

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

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

  price.sort()

  part = price[0:K]

  print(sum(part))

if __name__ == '__main__':
  main()

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


N,K=map(int,input().split())
n=list(map(int, input().split()))
m=sorted(n)
print(sum(m[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())
p = list(map(int,input().split()))
p = sorted(list(set(p)))

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

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

print(sum(list(set(p))))

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

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

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)[:K])

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

pr.sort()

print(sum(pr[0:k])

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


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 = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
print(sum[: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):
n, k = [int(j) for j in input().split(' ')]
p = input().split(' ')

p.sort()
sum = 0

for i in range(0,k):
  sum+=p[i]
  
print(sum)

n, k = [int(j) for j in input().split(' ')]
p = input().split(' ')
 
p.sort()
sum = 0
 
for i in range(0,k):
  sum+=int(p[i])
  
print(sum)

n, k = [int(j) for j in input().split(' ')]
p = input().split(' ')
 
p.sort()
sum = 0
 
for i in range(0,k):
  sum+=int(p[i])
  
return sum

n, k = [int(j) for j in input().split(' ')]
p = [int(j) for j in input().split(' ')]
 
p.sort()
sum = 0
 
for i in range(0,k):
  sum+=p[i]
  
print(sum)

Verdicts: 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 = input()
k = input()
price = []
cost = 0
for p in range(n + 1):
        p = int(input())
        price.append(p)

price.sort(reverse = True)
for  p in price:
        cost += p

print(price)

n = int(input())
k = int(nput())
price = []
cost = 0
for p in range(n):
        p = int(input())
        price.append(p)

price.sort()
for  p in price:
        cost += p

print(price)

n = int(input())
k = int(input())
price = []
cost = 0
for p in range(n):
        p = int(input())
        price.append(p)

price.sort()
del price[k:]
for p in price:
        cost += p

print(cost)

n = int(input())
k = int(nput())
price = []
cost = 0
for p in range(n + 1):
        p = int(input())
        price.append(p)

price.sort()
for  p in price:
        cost += p

print(price)

n = int(input())
k = int(nput())
price = []
cost = 0
for p in range(n):
        p = int(input())
        price.append(p)

price.sort()
for  p in price:
        cost += p

print(price)

n, k,  =map(int, input().split())
cost = 0
price = list(map(int, input().split()))
        
price.sort()
del price[k:]
for p in price:
        cost += p

print(cost)

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

print(sum(p[0:K])

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

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

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

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

print(sum(sorted(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 = map(int, input().split())

print(sum(sorted(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(input().split()))

P.sort()
price=0
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

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
from itertools import combinations
if n==1:
    print(int(input()))
else:
    n,k = map(int,input().split())
    lis = input().split()
    total =np.inf

    for i in combinations(lis,k):
        ml =0

        for a in i:

            ml += int(a)

        total = min(total,ml)


    print(total)

n,k = map(int,input().split())
if n==1:
    print(int(input()))
else:
    total = 0
    lis = list(map(int,input().split()))
    lis.sort()
    for i in range(k):
        total += lis[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):
n,k=map(int,input().split())
l1=list(map(int.input().split()))
l1.sort()
price = 0
count= 0
for i in range(n-1):
  if count=k:
      break
  else:    
     if l1[i]!=l1[i+1]:
          price+=l1[i]
          count+=1
print(price)    

n,k=map(int,input().split())
l1=list(map(int.input().split()))
l1.sort()
price = 0
for i in range(n-1):
  if l1[i]!=l1[i+1]:
    price+=l1[i]
print(price)    
    

N, K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(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=(int(x) for x in input.split())
array = list(map(int, input().strip().split()))
print(f'{n} {k}')
print(sum(array[0:k]))

n,k=(int(x) for x in input().split())
mylist=list(map(int, input().strip().split()))
mylist.sort()
num=0
suma=0
while num < k:
    suma=suma+mylist[num]
    num += 1
print(suma)

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

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

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 = sorted(map(int, input().split()))
print(A[:K])

N, K = map(int, input().split())
A = sorted(map(int, input().split()))
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):
n, k = input().split()
lists = list(input().split())
for i in range(int(n)):
    lists[i] = int(lists[i])
lists.sort()
for i in range(int(k)):
  sum_fruit = sum_fruit + int(lists.pop(0))
print(str(sum_fruit))

n, k = input().split()
lists = list(input().split())
for i in range(int(n)):
    lists[i] = int(lists[i])
lists.sort()
sum_fruit = 0
for i in range(int(k)):
  sum_fruit = sum_fruit + int(lists.pop(0))
print(str(sum_fruit))

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):
x=input()
if x.isupper()==True:
    print("A")
else:
    print("a")


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):
a,b = map(int,input().split())
lol = [int(n) for n in input().split()]
lol.sort()
print(sum(lol[:k]))

a,b = map(int,input().split())
lol = [int(n) for n in input().split()]
lol.sort()
print(sum(lol[:b]))

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())
prices = list()
for i in range(N):
    prices.append(int(input()))
sum = 0
for i in prices:
    x = min(prices)
    sum = sum + x
    prices.remove(x)
    K = K - 1
    if K == 0: break
print(sum)


def main():
    
    kinds = list(map(int,input().split()))
    prices = list(map(int,input().split()))
    
    minPrice = 0
    
    for item in range(kinds[1]):
        minPrice += min(prices)
        prices.remove(min(prices))

    print(minPrice)         
    
  

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):
init = input().split()
N = int(init[0])
K = int(init[1])

prices = [int(input()) for i in range(N)]
prices.sort()

sum = 0
for i, ele in enumerate(prices):
  if i == K:
    break
  else
  	sum = sum + ele
print(sum)

init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = [int(input()) for i in range(N)]
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else
  	sum = sum + ele
print(sum)

init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = list(map(int, input().split()))
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else:
  	sum = sum + ele
print(sum)

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, *p = map(int, open(0).read().split())

import itertools
lis = list(itertools.combinations(range(N), 3))

if len(lis) == 0:
    print(p[0])
    import sys
    sys.exit()

mi = -1
for x in lis:
    cur = 0
    for pos in x:
        cur += p[pos]

    print(cur)

    if mi == -1:
        mi = cur
    else:
        mi = min(mi, cur)

print(mi)
#print(lis)


N, K, *p = map(int, open(0).read().split())

sortp = sorted(p)

ans = 0
for x in range(K):
    ans += sortp[x]
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())
list_ = list(map(int, input().split()))
sorted(list_)

print(sum(list_[:k]))

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

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

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

n,k=map(int,input().split())
p=input().split()
p2=[]
for i in range(n):
  p3=int(p[i])
  p2.append(p3)
p1=sorted(p2)
c = 0
for i in range(k):
  c += int(p1[i])
print(c)

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 = [int(e) for e in input().split()]

p.sort

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

print(ans)

n, k = map(int, input().split())
p = [int(e) for e in 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):
s=input()
if s.isupper():
 print("A")
else:
 print("a")

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

N, K = int(input())
p = [int(i) for i in input().split()]
p_ascending = p.sort()
total = 0
for i in p_ascending[0,K]:
  total += i
  
print total
  

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

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

length= int(input())
num=int(input())
i=0
j=0
p=0
fruits=[]
for i in range(length):
	fruits.append(int(input())
fruits.sort()
for j in range(num):
	p+=fruits[j]
print(p)
# for x in fruits:
# 	print(x)

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

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




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

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())
li = [int(i) for i in input().split()]
total = 0

for _ in range(K):
	total += min(li)
	li = li.remove(min(li))

print(total)

N,K = map(int,input().split())
li = [int(i) for i in input().split()]
total = 0
 
for _ in range(K):
	total += min(li)
	li.remove(min(li))
 
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):
_, k = input().split()
 
prices = input().split().map(lambda x : int(x))
 
prices.sort()
 
sum = 0
for i in range(int(k)):
	sum += prices[i]
print(sum)

_, k = input().split()
 
prices = input().split().map(lambda x : int(x))
 
prices.sort()
 
sum = 0
for i in range(k):
	sum += prices[i]
print(sum)

_, k = input().split()
 
prices = list(input().split().map(lambda x : int(x)))
 
prices.sort()
 
sum = 0
for i in range(int(k)):
	sum += prices[i]
print(sum)

_, k = input().split()

prices = input().split().map(lambda x : int(x))

prices.sort()

sum = 0
for i in range(k):
	sum += prices(i)
print(sum)

_, k = input().split()
 
prices = list(map(lambda x : int(x), input().split()))
 
prices.sort()
 
sum = 0
for i in range(int(k)):
	sum += prices[i]
print(sum)

Verdicts: 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):
#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;

int main() {
    int n,k,ans = 0;
    cin >> n >> k;
    vector<int> p(n);
    rep(i,n) cin >> p[i];
    sort(p.begin(), p.end());
    rep(i,k) ans+=p[i];
    cout << ans << endl;
}

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

N, K = map(int, input().strip().split())
p = list(map(int, input().strip().split()))
p = sorted(p)
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()))
sorted(p)
print(p[0]+p[1]+p[2])

N,K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
if len(p) >= 3:
    print(p[0]+p[1]+p[2])
else if len(p) == 2:
    print(p[0] + p[1])
else:
    print(p[0])
    

N,K = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
count = 0
if len(p) >= K:
    for i in range(K):
        count = count + p[i]
else:
    for i in p:
        count = count + i
        
print(count)

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())
fruit = [int(i) for i in input().split()]

fruit.sort()
price = 0
for i in range(N) :
    if i>3 :
        break
    price += fruit[i]
    
print(price)

N,K = map(int,input().split())
fruit = [int(i) for i in input().split()]

fruit.sort()
price = 0
for i in range(N) :
    if i>K-1 :
        break
    price += fruit[i]
    
print(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 = input().split()
a = list()
a = input().split(" ")
a.sort()
#while i<int(k): 
 #   print(a[i])
  #  i-=1
k = int(k)
i = 0
sum = 0
while i<k:
    print(int(a[i]))
    sum+=int(a[i])
    i+=1
    
print(sum)

n,k = input().split()
a = list()
a = input().split(" ")
a.sort()

k = int(k)
i = 0
sum = 0
while i<k:
    sum+=int(a[i])
    i+=1
    
print(sum)

n,k = input().split()
k = int(k)-1
a = list()
a = input().split(" ")
b = list()
for i in a:
    b.append(int(i))
b.sort()
sum = 0
while k>=0:
    sum += b[k]
    k -= 1
print(sum)

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

p = sorted(p)

print(sum(p[:N]))

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

p = sorted(p)

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

array.sort()
print(sum(array[:k]))


m, k = map(int, input().split())
array = list(map(int, input().split()))

array.sort()
print(sum(array[: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())
value = []
sum = 0

for i in range(N):
    value.append(int(input())) 
newValue = sorted(value)

for j in range(K):
    sum = sum + newValue[j]

print(sum)

N = list(map(int,input().split()))
value = list(map(int,input().split()))
sum = 0
newValue = sorted(value)
for i in range(N[1]):
    sum = sum + newValue[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):
nk=input().split()
n=int(nk[0])
k=int(nk[1])
data=list(map(int,input().split()))
data2=data.sort()
s=0
for i in range(k):
    s += data2[i]
print(s)

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

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

n,k=map(int,input().split())
p=[]
a,*b=map(int,input().split())
p.append(a)
for i in range(len(b)):
    p.append(b[i])
p.sort()
y=0
for i in range(k):
    y=y+p[i]
print(y)

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

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 = sorted(p)

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

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

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


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

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

#ABC171B
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):
import collections

s = [int(i) for i in input().split(" ")]
print(s)
p = [int(i) for i in input().split(" ")]
print(p)
a = []
p.sort()
print(p)

for i in range(0,s[1]):
	a = p[i]
b = [int(b) for b in a]
print(sum(b))


import collections

s = [int(i) for i in input().split(" ")]
print(s)
p = [int(i) for i in input().split(" ")]
print(p)
p.sort()
print(p)
a = []

for i in range(0,s[1]):
	a.append(p[i])
print(sum(a))


import collections

s = [int(i) for i in input().split(" ")]
p = [int(i) for i in input().split(" ")]
p.sort()
a = []

for i in range(0,s[1]):
	a.append(p[i])
print(sum(a))

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 = input()
m = n.split()
l = m[2:]
s = sorted(l, reverse=True)
p = 0
for i in range(0,int(m[1])):
    p = p + int(l[i])
print(int(p))

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

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

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

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

for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]
print(m,a,b)

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

n = input()
m = n.split()
print(m)
l = m[2:]
a = sorted(l, reverse=True)
p = 0
for i in range(0,int(m[1])):
    p = p + int(c[i])
print(int(p))

n = input()
m = n.split()
for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]

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

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

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

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

n = input()
m = n.split()
l = m[2:]
a = sorted(l, reverse=True)
p = 0
for i in range(0,int(m[1])):
    p = p + int(c[i])
print(int(p))

n = input()
m = n.split()
for i in range(0, len(m)):
    m[i] = int(m[i])
a = m[0]
b = m[1]
m = m[2:]
p = 0
for i in range(a-b,a):
    p = p + int(m[i])
print(int(p))

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

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

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

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

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

c = sorted(b, reverse=True)
print(c)
p = 0
for i in range(int(m[0]) - int(m[1]),int(m[0])):
    p = p + int(c[i])
print(int(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])
print(p)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

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(i) in input().split()]
p = [int(i) in input().split()]
p.sort()
print(sum(p[:k])

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

price = 0
for j in range(3):
    price += p[j]
print(price)

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

price = 0
if N > 0:
    for j in range(3):
        price += p[j]
print(price)

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

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

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

price = 0
if N > 0:
    for j in range(K):
        price += p[j]
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()))

p = sorted(p)

print(p)

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 = sorted(p)


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

n, k = map(int,input().sprit())
a = list(map(int,input().sprit()))
a.sort()
b = 0
for i in range(k)
	b += a[k]
print(b)

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

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

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

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

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: 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 = int(input()), int(input())
lst = []
result = []
for i in range(n):
    lst.append(int(input()))
for i in range(k):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))

n = int(input())
k = int(input())
lst = []
result = []
for i in range(n):
    lst.append(int(input()))
for i in range(k):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))

n = list(int(num) for num in input().strip().split())
lst = list(int(num) for num in input().strip().split())[:n[0]]
result = []
for i in range(n[1]):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))

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):
a,b = input()
listA = list(map(int,input().split()))
listA.sort()
all = 0

for i in range(b):
  all = all + list[i]

print(all)

a,b = map(int,input().split())
listA = list(map(int,input().split()))
listA.sort()
all = 0

for i in range(b):
  all = all + listA[i]

print(all)

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

p.sort()

print(sum(p[:k]))


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

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

p.sort()

print(sum(p[:k]))

Verdicts: Runtime Error

Accepted