mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2025-02-17 14:26:47 +00:00
P5738 【深基7.例4】歌唱比赛
R38743182
This commit is contained in:
parent
a30ae101e2
commit
1d766c6c20
42
problem/P5738/P5738.cpp
Normal file
42
problem/P5738/P5738.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// R38743182
|
||||||
|
|
||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
struct node {
|
||||||
|
int score[22];
|
||||||
|
double sum, all;
|
||||||
|
|
||||||
|
node() {
|
||||||
|
memset(this->score, 0x00, sizeof(this->score));
|
||||||
|
all = sum = 0.00;
|
||||||
|
}
|
||||||
|
|
||||||
|
void t(int m) {
|
||||||
|
for (int i = 0; i < m; i++) {
|
||||||
|
cin >> score[i];
|
||||||
|
}
|
||||||
|
std::sort(score, score + m);
|
||||||
|
for (int i = 1; i + 1 < m; i++) {
|
||||||
|
sum += score[i];
|
||||||
|
}
|
||||||
|
all = sum / (m - 2.00);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool cmp(node a, node b) {
|
||||||
|
return a.all > b.all;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int n, m;
|
||||||
|
node student[105];
|
||||||
|
cin >> n >> m;
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
student[i].t(m);
|
||||||
|
}
|
||||||
|
sort(student, student + n, cmp);
|
||||||
|
printf("%.2lf", student[0].all);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user