团体天梯练习 L2-015 互评成绩
L2-015 互评成绩
学生互评作业的简单规则是这样定的:每个人的作业会被
输入格式:
输入第一行给出3个正整数
输出格式:
按非递减顺序输出最后得分最高的
输入样例:
6 5 3
88 90 85 99 60
67 60 80 76 70
90 93 96 99 99
78 65 77 70 72
88 88 88 88 88
55 55 55 55 55
输出样例:
87.667 88.000 96.000
解题思路
水题。就是要求比较多,需要求出最高的
/* 一切都是命运石之门的选择 El Psy Kongroo */
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<cmath>
#include<functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<double, double> pdd;
typedef pair<string, int> psi;
typedef __int128 int128;
#define PI acos(-1.0)
#define x first
#define y second
//int dx[4] = {1, -1, 0, 0};
//int dy[4] = {0, 0, 1, -1};
const int inf = 0x3f3f3f3f, mod = 1e9 + 7;
const int N = 1e4 + 10;
int n, m, k;
priority_queue<double> q;
double st[N];
int top = -1;
int main(){
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
cin >> n >> k >> m;
while(n -- ){
int sum = 0, maxv = 0, minv = inf, v;
for(int i = 0; i < k; i ++ )
cin >> v, sum += v, maxv = max(maxv, v), minv = min(minv, v);
sum -= maxv + minv; //删除最高分和最低分
double ave = sum * 1.0 / (k - 2);
q.push(ave);
}
while(m -- ){ //求出前m个最高平均分
st[ ++ top] = q.top();
q.pop();
}
while(top) printf("%.3lf ", st[top -- ]);
printf("%.3lf\n", st[top]);
return 0;
}
一切都是命运石之门的选择,本文章来源于博客园,作者:MarisaMagic,出处:https://www.cnblogs.com/MarisaMagic/p/17327347.html,未经允许严禁转载
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具