第40872题 单选题
学校举行编程比赛,共有 M 个班级参加,总计 N 名学生提交了作品。每份作品有一个班级编号(1 到 M)和得分。现需要统计每个班级的最高得分,并计算所有班级最高得分的总和。分数为非负数。以下程序试图实现此功能,横线处应填写的代码是?( )
M, N = map(int, input().split())
max_score = [0] * (M + 1)
for _ in range(N):
    cls, score = map(int, input().split())
    _____①_____
        max_score[cls] = score
_____②_____
print(total)
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析