TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
a = input()
if a.islower:
  print(a)
elif a.isupper:
  print(a)


a = input()
if a.isupper==True:
  print('A')
else:
  print('a')


a = input()
if a.islower:
  print('a')
elif a.isupper:
  print('A')


a = input()
if a.isupper():
  print('A')
else:
  print('a')

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
#!/usr/bin/env python
# ---------------------------------------------------------------------------------------!
import os
import sys
from io import BytesIO, IOBase
# from bisect import bisect_left as bl                #c++ lowerbound bl(array,element)
# from bisect import bisect_right as br               #c++ upperbound br(array,element)


# ---------------------------------------MAIN()-----------------------------------------------!
def main():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
    a = input()
    if(a.isupper()):
        print("A")
    else:
        print("a")


# -----------------------------------------------------------------------------------------!
# region fastio
BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def _init_(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def _init_(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
def input(): return sys.stdin.readline().rstrip("\r\n")




if __name__ == "__main__":
    main()


 a = input()
    if(a.isupper()):
        print("A")
    else:
        print("a")

if(a.isupper()==True):
        print("A")
    else:
        print("a")

a=input()
if(a.isupper()):
    print("A")
else:
    print("a")

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
class henkan:

    def __init__(self, a):

        if(a.islower()):
            henkan.upper1(a)
        else:
            henkan.lower1(a)
    
    def upper1(a):
        print(a.upper())
    
    def lower1(a):
        print(a.lower())



a = input()
henkan(a)



class henkan:

    def __init__(self, a):

        if(a.islower()):
            henkan.upper1(a)
        else:
            henkan.lower1(a)
    
    def upper1(a):
        print("a")
    
    def lower1(a):
        print("A")



a = input()
henkan(a)



Verdicts: Wrong Answer

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
N=0

N = int(input())
K = int(input())
p = [int(input()) for i in range(N)]

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


S = input()
if(S.isupper()):
    printf('A')
else:
    printf('a')


S = input()
if(S.isupper()):
    print('A')
else:
    print('a')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
a = input()

dic = {
  'A':'a','B':'b','C':'c','D':'d','E':'e','F':'f','G':'g',
  'H':'h','I':'i','J':'j','K':'k','L':'l','M':'m','N':'n',
  'O':'o','P':'p','Q':'q','R':'r','S':'s','T':'t','U':'u',
  'V':'v','W':'w','X':'x','Y':'y','Z':'z'
  }

if a in list(dic.keys()):
  print(dic[a])
  exit()

print(a)

a = input()

if a.isupper():
  print('A')
  exit()

print('a')

Verdicts: Wrong Answer

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):


import string

N = int(input())
alpha = list(string.ascii_lowercase)
alpha.append('')


value = []
value.append(alpha[N // (26**10) - 1])

for i in range(10,1,-1):
  value.append(alpha[(N % (26**i)) // (26**(i-1)) - 1])

value.append(alpha[N % (26**1) - 1])

value = ''.join(value)
print(value)

alpha = input()

if alpha.islower():
  print('a')
else:
  print('A')

Verdicts: Runtime Error

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
s = SI()
if s.isLower():
	print("a")
else:
	print("A")

import sys
import math
def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
s = SI()
if s.islower():
	print("a")
else:
	print("A")

Verdicts: Runtime Error

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
# coding: utf-8

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

A.sort()

dict_a = dict()

for a in A:
    if not (a in dict_a):
        dict_a[a] = 1
    else:
        dict_a[a] += 1


Q = int(input())

B = []
C = []

sums = []
for i in range(Q):
    b, c = list(map(int, input().split()))
    B.append(b)
    C.append(c)

for b, c in zip(B, C):
    if (b in dict_a):
        num = dict_a[b]
    
        if not (c in dict_a):
            dict_a[c] = num
        else:
            dict_a[c] += num

        dict_a.pop(b)

    keys = dict_a.keys()
    vals = dict_a.values()

    sumval = 0
    for k, v in zip(keys, vals):
        sumval += k * v

    print(sumval)
    


char = input()

flg = char.isupper()

if flg:
    print('A')
else:
    print('a')

    

Verdicts: Runtime Error

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
t = input()
if(t.islower()):
  print(t.upper())
else:
  print(t.lower())

t = input()
if(t.islower()):
  print('A')
else:
  print('a')

t = input()
if(t.islower()):
  print('a')
else:
  print('A')

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
s = input()

if s.islower():
  print(s.upper())
else:
  print(s.lower())

s = input()
 
if s.islower():
  print('a')
else:
  print('A')

Verdicts: Wrong Answer

Accepted
Problem: An uppercase or lowercase English letter \alpha will be given as input. If \alpha is uppercase, print `A`; if it is lowercase, print `a`.

Submission attempts (in order):
n=int(input())
l=list(map(int,input().split()))
q=int(input())
before=[]
after=[]
for i in range(q):
    a,b=input().split()
    before.append(int(a))
    after.append(int(b))
    
for i in range(q):
  if before[i] in l:
    l=[after[i] if j == before[i] else j for j in l]
  print(sum(l))


a=str(input())

if a.isupper()==True:
  print("A")

else:
  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):
a=input()
l=a.split(" ")
n=int(l[0])
k=int(l[1])
f=input()
fruits=int(f.split(" "))
for d in range(0, len(fruits)):
    fruits[d]=int(fruits[d])
ans=0
b=0
while(b<k):
    g=max(fruits)
    ans+=g
    fruits.remove(g)
    b+=1
print(ans)

a=input()
l=a.split(" ")
n=int(l[0])
k=int(l[1])
f=input()
fruits=f.split(" ")
for d in range(0, len(fruits)):
    fruits[d]=int(fruits[d])
ans=0
b=0
while(b<k):
    g=min(fruits)
    ans+=g
    fruits.remove(g)
    b+=1
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())
l=list(map(int,input().split()))
s=0
l.sort()
x=l[:m]
print(x)   
print(sum(x))


n,m=map(int,input().split())
l=list(map(int,input().split()))
s=0
l.sort()
x=l[:m]
print(sum(x))


Verdicts: Wrong Answer

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

Submission attempts (in order):
prices = []
total_fruits = 0
max_numb = 0

total_fruits, max_numb = input().split(' ')
tmp_prices = input().split(' ')
tmp_prices.sort()
ans = 0
for i in range(int(max_numb)):
  ans += int(tmp_prices[i])
  
print(ans)
  

prices = []
total_fruits = 0
max_numb = 0

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

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

n, k = input().split()
sum(input().split().sorted()[:k])

n, k = input().split()
sum(sorted([int(i) for i in input().split()])[:k])

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

num_list.sort()
ans = 0

for i in range(k):
  ans += num_list[i]
else:
  print(ans)

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

num_list.sort()
ans = 0

for i in range(k):
  ans += num_list[i]
else:
  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=list(input().split(" "))
B=list(input().split(" "))
C=sorted(B)
D=[]
M=0
for i in range(int(A[1])):
    D.append(int(C[i]))
for j in range(len(D)):
    M=D[j]+M
print(M)

A=list(input().split(" "))
B=list(input().split(" "))
for i in range(len(B)):
    B[i]=int(float(B[i]))
C=sorted(B)
D=[]
M=0
for i in range(int(A[1])):
    D.append(int(C[i]))
for j in range(len(D)):
    M=D[j]+M
print(M)

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

P.sort()
 
total=0

for i in range(int(K)+1):
  total=total+P[i]
 
print(total)

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

# N=5
# K=2
# P=[10, 20, 40, 2, 6]

P.sort()
 
total=0

for i in range(int(K)+1):
  total=total+P[i]
 
print(total)

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

P.sort()

total=0
for i in range(K):
  total=total+P[i]
 
print(total)



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

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

P.sort()
 
total=0

for i in range(int(K)):
    total=total+P[i]
 
print(total)

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):
l=map(int,open(0).read().split());print(sum(sorted(l[2:])[:l[1]]))

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

a,b,*l=map(int,open(0).read().split());print(sum(sorted(l)[:b]))

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):
fluit_num,fluit_buy=input().split()
print(fluit_num,fluit_buy)
p = input().split()
print(p[:4])



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

Verdicts: Wrong Answer

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

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

for i in range(len(prices)):
    prices[i] = int(prices[i])

pricesSum = 0
while K > 0:
    newFruit = min(prices) 
    index = prices.index(newFruit)
    prices.pop(index)
    pricesSum += newFruit
    K -= 1

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

for i in range(len(prices)):
    prices[i] = int(prices[i])

pricesSum = 0
while K > 0:
    newFruit = min(prices) 
    index = prices.index(newFruit)
    prices.pop(index)
    pricesSum += newFruit
    K -= 1
    
print(pricesSum)

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

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

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

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

print(sum(p[:k]))

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

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


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

p = sorted(p)

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

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

pp = sorted(map(int, input().split()), reverse=True)

print(sum(pp[:k]))

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

pp = sorted(map(int, input().split()))

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

print(sum)



N, K = map(int, input().split())
prices = sorted(list(map(int, input().split())))
sum = 0
for i in range(0,K) :
    sum = sum + prices[i]

print(sum)



Verdicts: Wrong Answer

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

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

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

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

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: Wrong Answer

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

p.sort()
print(p)

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

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

p.sort()
#print(p)

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

Verdicts: Wrong Answer

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

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

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

print(sum)

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

sum = 0
for i in range(int(k)):
    sum = sum + list_in[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 = input()
K = input()
lists = []
A = 0

for i in range(int(N)):
  lists.append((input()))
 
lists.sort()
 
for j in range(int(K)):
  A += int(lists[j])
 
print(A)

N = input()
K = input()
lists = []
B = 0

for i in range(int(N)):
    A = input()
    lists.append(int(A))
    #print(A)

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

N = input()
K = input()
lists = []
A = 0

for i in range(int(N)):
  lists.append((input()))
 
lists.sort()
 
A = sum(lists[:K])
 
print(A)

N = input()
K = input()

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

list.sort()

for j in range(K):
  A += list[j]

print(A)

N = input()
K = input()
 
for i in range(N):
  list[i] = input()
 
list.sort()
 
for j in range(K):
  A += list[j]
 
print(A)

N,K = input().split()
lists = []
B = 0

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

lists.sort()
#print(lists)

for j in range(int(K)):
  B += int(lists[j])
 
print(B)

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

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n,k=map(int,input().split())
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,k = list(map(int,input().split()))
arr = list(map(int,input().split()))
arr.sort()
print(sum(arr[:k])

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

status = line[0].split()
fruits = line[1].split()

i = 1
total = 0
for fruit in fruits:
    i += 1
    total += int(fruit)
    if int(status[1]) < i:
        break
print(total)


line = [input() for i in range(2)]

status = [int(x) for x in line[0].split()]
fruits = [int(x) for x in line[1].split()]

status
fruits = sorted(fruits)

i = 1
total = 0
for fruit in fruits:
    i += 1
    total += int(fruit)
    if int(status[1]) < i:
        break
print(total)


Verdicts: Wrong Answer

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

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

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

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

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

Verdicts: 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):
import itertools
prod = functools.partial(functools.reduce, operator.mul)
n,k=map(int,input().split())
price=list(map(int,input().split()))

n_list=[]
for com in itertools.combinations(price,k):
    s=sum(com)
    n_list.append(s)
print(min(n_list))

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

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


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


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


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N,K = map(int,input().split(' '))
P = list(map(int,input().spllit(' ')))
if(k==1):
  print(min(P))
else:
  res=[]
  for i in range(K):
    res[i].append(min(P))
    P.remove(min(P))
  print(sum(res)) 

N,K = map(int,input().split(' '))
P = list(map(int,input().split(' ')))
if(K==1):
  print(min(P))
else:
  res=[]
  for i in range(K):
    res.append(min(P))
    P.remove(min(P))
  print(sum(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()
_sum=0
for i in range(k):
  _sum += p[k]
print(_sum)

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

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

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

sp = sorted(p)
print(sum(sp[:K]))


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

sp = sorted(p)
print(sum(sp[: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()))
b = list(map(int,input().split()))
b.sort()
print(b)
d = b[0:a[1]]
print(sum(d))



a = list(map(int,input().split()))
b = list(map(int,input().split()))
b.sort()
d = b[0:a[1]]
print(sum(d))



Verdicts: Wrong Answer

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

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

if n == len(l):
  pass
else:
  return

for i in range(k):
  shukei += min(l)
  l.remove(min(l))

print(shukei)

n, k = map(int, input().split())
p = input()
x = p.split()
l = [int(s) for s in x]
shukei = 0

def shukei_def():
    global shukei
    if n == len(l):
        for i in range(k):
            shukei += min(l)
            l.remove(min(l))
        else:
            return

shukei_def()

print(shukei)

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


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):
import sys

input_list = sys.stdin.readlines()

count = 1
get_count = 0
get_value_count = 0
for i in input_list:
  get_values = i.split()
  if count == 1:
    get_value_count = int(get_values[0])
    get_count = int(get_values[1])
  else:
    if get_value_count == 1:
      print(get_values[0])
    else:
      get_values.sort()
      count_value = 1
      p = 0
      for c in get_values:
        if count_value > get_count:
          print(str(p))
        else:
          p = p + int(c)
        count_value = count_value + 1
  count = count + 1

import sys

input_list = sys.stdin.readlines()

count = 1
get_count = 0
get_value_count = 0
output = 0
for i in input_list:
  get_values = i.split()
  if count == 1:
    get_value_count = int(get_values[0])
    get_count = int(get_values[1])
  else:
    if get_value_count == 1:
      output = get_values[0]
    else:
      new_list = sorted(get_values, key=int)
      count_value = 1
      for c in new_list:
        if count_value > get_count:
          break
        else:
          output = output + int(c)
        count_value = count_value + 1
  count = count + 1
print(str(output))

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

prices = prices.sorted()

answer = 0
for i in range(0, k, 1):
  answer = answer + prices[i]
print(answer)

import numpy as np

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

prices_arr = np.array(prices)
answer = prices_arr[0:k].sum()

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):
5 3
50 100 80 120 80

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 = mapt(int, input().split(" "))
p = mapt(int, input().split(" "))
print(sum(sorted(p)[:3]))

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

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

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

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=[0]*(N+1);w=0
P=list(map(int,input().split()))
for i in range(1,N+1):
  S[i-1]=[i,P[i-1]]
S[-1]=[0,1000]
S.sort(key=lambda x: x[1])
print(S)
for i in range(K):
  w=w+S[i][1]
print(w)

N,K=map(int,input().split())
S=[0]*(N+1);w=0
P=list(map(int,input().split()))
for i in range(1,N+1):
  S[i-1]=[i,P[i-1]]
S[-1]=[0,1000]
S.sort(key=lambda x: x[1])
#print(S)
for i in range(K):
  w=w+S[i][1]
print(w)

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=(int(x) for x in input().split())
num_list = list(map(int, input().split())).sort
ans = 0

for i in range(b):
  ans += num_list[i]

print(ans)


a,b=(int(x) for x in input().split())
num_list = list(map(int, input().split())).sort
ans = 0

for i in range(b):
  ans += num_list[b]

print(ans)


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

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

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=input().split()
N=int(N)
K=int(K)
a=[]
a=[int(a) for a in input().split()]
a.sort()
print(sum(a[0:K-1])

N,K=input().split()
N=int(N)
K=int(K)
a=[]
a=[int(a) for a in input().split()]
a.sort()
print(sum(a[0:K-1]))

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

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):
a,b = map(int,input().split())
l = map(int,input().split())
l = sorted(l)
print(l)
if(a<=b):
    print(sum(l))
else:
    print(sum(l[:b]))

a,b = map(int,input().split())
l = map(int,input().split())
l = sorted(l)
print(l)
print(sum(l[:b]))

a,b = map(int,input().split())
l = list(map(int,input().split()))
l = sorted(l)
print(sum(l[:b]))


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

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

Verdicts: Wrong Answer

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

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

print(s)

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

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

print(s)

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

print(s)

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

print(s)

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

if __name__ == "__main__":
	main(

def main():
	n, k = map(int, input().split())
	P = list(map(int, input().split()))
	sorted_p = sorted(P)
	ans = sum(sorted_p[:k])
	print(ans)
	return

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

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

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

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

p.sort()
total=0

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

Verdicts: Wrong Answer

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

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

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

price2 = sorted(price)
i = 0
sum = 0
while (i < K):
  sum += price2[i]
  i += 1

print(sum)

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

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

price2 = sorted(price)
i = 0
sum = 0
while (i < K):
  sum += price2[i]
  i += 1

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

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

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):
if __name__ == "__main__":
    N,k = [int(item) for item in input().split()]
    price_arr = [int(p) for p in input().split()]
    print(sum(sorted(price_arr,reverse=True)[:k]))

if __name__ == "__main__":
    N,k = [int(item) for item in input().split()]
    price_arr = [int(p) for p in input().split()]
    print(sum(sorted(price_arr)[:k]))

Verdicts: Wrong Answer

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

Submission attempts (in order):
N.K=map(int,input().split())
P=sorted(list(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 = list(map(int, input().split()))
A = list(map(int, input().split()))

ans = 0

B=sorted(A)

for a in B[::-K]:
  ans += a
  if ans > 10**18:
    print('-1')
    break
else:
  print(ans)

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

ans = 0

B=sorted(A)

for a in B[:K]:
  ans += a
  if ans > 10**18:
    print('-1')
    break
else:
  print(ans)

Verdicts: Wrong Answer

Accepted