1 solutions

  • 0
    @ 2025-9-29 13:57:43
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      int n, m;
        cin >> n >> m;
        vector<vector<double>> scores(n, vector<double>(m));
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                cin >> scores[i][j];
            }
        }
        double max_score = 0.0;
        for (int i = 0; i < n; ++i) {
            sort(scores[i].begin(), scores[i].end());
            double sum = 0.0;
            for (int j = 1; j < m - 1; ++j) {
                sum += scores[i][j];
            }
            double avg = sum / (m - 2);
            if (avg > max_score) {
                max_score = avg;
            }
        }
        cout << fixed << setprecision(2) << max_score << endl;
        return 0;
    }```
    • 1

    Information

    ID
    4715
    Time
    1000ms
    Memory
    125MiB
    Difficulty
    2
    Tags
    (None)
    # Submissions
    2
    Accepted
    1
    Uploaded By