Юрий Танк
Ученик
(122),
на голосовании
1 неделю назад
Скиньте ответы с пайтона от этого кода: from itertools import combinations def calculate_scores(x, y): question_values = [10, 20, 30, 40, 50] possible_results = set() for correct_questions in combinations(question_values, x): remaining_questions = [q for q in question_values if q not in correct_questions] for wrong_questions in combinations(remaining_questions, y): score = sum(correct_questions) - sum(wrong_questions) possible_results.add(score) sorted_results = sorted(possible_results) return sorted_results x, y = map(int, input().split()) results = calculate_scores(x, y) print(" ".join(map(str, results)))
from itertools import combinations
def calculate_scores(x, y):
question_values = [10, 20, 30, 40, 50]
possible_results = set()
for correct_questions in
combinations(question_values, x):
remaining_questions = [q for q in question_values if q not in correct_questions]
for wrong_questions in combinations(remaining_questions, y):
score = sum(correct_questions) - sum(wrong_questions)
possible_results.add(score)
sorted_results = sorted(possible_results)
return sorted_results
x, y = map(int, input().split())
results = calculate_scores(x, y)
print(" ".join(map(str, results)))