Problem p02628 (python)

Fixed submission:
S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = []
for l in range(K):
  lists.append(min(p))
  p.remove(min(p))
  
print(sum(lists))

Buggy submission (verdict: Runtime Error):
S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = []
for l in range(K):
  lists.append(min(p))
  lists.drop(min(p))
  
print(sum(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = []
for l in range(K):
  lists.append(min(l))
  lists.drop(min(l))
  
print(sum(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = [1000000000000]
x = list(itertools.combinations(p, K))
counts = len(list(x))
for l in range(1,x+1):
    sums = sum(list(x[counts - 1]))
    if int(sums) <= int(lists[l-1]):
        lists.append(sums)
    else:
        continue

print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = [1000000000000]
x = list(itertools.combinations(p, K))
counts = len(list(x))
  for l in range(1,x+1):
    sums = sum(list(x[counts - 1]))
  	if sums <= lists[l-1]:
    	lists.append(sums)
    else:
        continue

print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
S = list(map(int, input().strip().split()))
N = S[0]
K = S[1]
p = list(map(int, input().strip().split()))
lists = [1000000000000]
x = itertools.combinations(p, K)
counts = len(list(x)
  for l in range(1,x+1):
    sums = sum(list(l))
  	if sums <= lists[l-1]:
    	lists.append(sums)
    else:
        continue

print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
S = list(map(int, input().strip().split()))
N = S[0]
K = s[1]
p = list(map(int, input().strip().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)
 
print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
N = int(input().split())
K = int(input().split())
p = list(map(int, input().strip().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)
 
print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
N = int(input())
K = int(input())
p = list(map(int, input().strip().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)
 
print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools
 
N = int(input())
K = int(input())
p = list(map(int,input().split(" ")))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)
 
print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
K = int(input())
p = list(map(int,input().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)

print(min(lists))

Buggy submission (verdict: Runtime Error):
import itertools

N = int(input())
K = int(input())
p = list(map(int, input().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  lists.append(sums)

print(min(lists))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
p = list(map(int, input().split()))
lists = []
for l in itertools.combinations(p, K):
  sums = sum(list(l))
  return lists.append(sums)

print(min(lists))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
p = list(map(int, input().split()))
lists = []
for l in itertools.combinations(p, 3):
  sums = sum(list(l))
  return lists.append(sums)

print(min(lists))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
p = list(map(int, input().split()))
lists = []
  
for x,y,z in p:
  n = x + y + z
  return lists.append(n)

print(min(lists))