版本比较
【附代码】NOIP2025的组题确有问题?由 S->NOIP 的成绩散点图统计分析
正文
增加 3 行删除 3 行
210 行未改动全部展开2112122132142152152162172182192202202212222232243 行未改动2282292302312322322332342352365 行未改动210 行未改动全部展开def plot_scores(common_scores, contest1, contest2): if not common_scores: print("没有找到同时参加两个比赛的选手。") return
print(f"{place} {contest1} {contest2} 斯皮尔曼:", spearman_rho([x[0] for x in common_scores], [x[1] for x in common_scores])) x, y = zip(*common_scores) plt.figure(figsize=(10, 8)) plt.scatter(x, y, alpha=0.6, s=10)
if "2025" in contest1: plt.axvline(x=S1[place], color='r', linestyle='--') plt.axhline(y=N1[place], color='b', linestyle='--') plt.xlabel(f'{contest1} 分数')3 行未改动 plt.savefig(f'result_{place}_{contest1}_{contest2}.png', dpi=300) plt.show()
def main():
data = read_data(file_path) common_scores = find_common_participants(data, contest1, contest2) plot_scores(common_scores, contest1, contest2)
5 行未改动