Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
141469 胡海峰老师 19斯诺克比赛 Python3 Accepted 31 MS 3788 KB 617 2025-12-25 11:40:03

Tests(5/5):


Code:

# 输入:红球 黄 绿 棕 蓝 粉 黑 balls = list(map(int, input().split())) red = balls[0] # 红球数量 colors = balls[1:] # 各彩球数量:[黄,绿,棕,蓝,粉,黑] scores = [2, 3, 4, 5, 6, 7] # 各彩球分值 # 阶段1:有红球时,每次选存在的最高分彩球 max_score = 0 for i in range(6): if colors[i] > 0 and scores[i] > max_score: max_score = scores[i] phase1 = red * (1 + max_score) if red > 0 else 0 # 阶段2:按顺序清彩球(黄到黑) phase2 = sum(colors[i] * scores[i] for i in range(6)) # 总分 total = phase1 + phase2 print(total)