| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 141468 | 胡海峰老师 | 19斯诺克比赛 | Python3 | Compile Error | 0 MS | 0 KB | 295 | 2025-12-25 11:39:54 |
red, *colors = map(int, input().split()) scores = [2, 3, 4, 5, 6, 7] # 最大分值(有球的情况下) max_score = max(scores[i] for i in range(6) if colors[i] > 0, default=0) # 计算总分 total = red * (1 + max_score) + sum(colors[i] * scores[i] for i in range(6)) print(total)
File "Main.py", line 5
max_score = max(scores[i] for i in range(6) if colors[i] > 0, default=0)
^
SyntaxError: Generator expression must be parenthesized if not sole argument