Submission #671487

# Submission time Handle Problem Language Result Execution time Memory
671487 2022-12-13T05:58:49 Z dooompy Meandian (CEOI06_meandian) C++17
Compilation error
0 ms 0 KB
#include "libmean.h"
#include <bits/stdc++.h>

using namespace std;

int n;

int ans[1005];

void find5(vector<int> idx) {

    vector<pair<int, int>> total;

    for (int i = 0; i < 5; i++) {

        vector<int> temp;
        
        for (int j = 0; j < 5; j++) {
            if (i == j) continue;
            temp.push_back(idx[j]);    
        }

        int res = MedianScore(temp[0], temp[1], temp[2], temp[3]);

        total.push_back({res * 2, i});
    }

    sort(total.begin(), total.end());

    int mid = total[0].first + total[4].first - total[2].first;
    mid /= 2;

    ans[idx[total[2].second]] = mid;

    return;
}

int main()
{
    n = Init();

    fill(ans, ans+1005, -1);

    for (int t = 1; t <= n; t++) {
        vector<int> temp;
        for (int i = 1; i <= n; i++) {
            if (ans[i] == -1) {
                temp.push_back(i);
            }

            if (temp.size() == 5) break;
        }

        find5(temp);


    }

} 

Compilation message

meandian.cpp: In function 'void find5(std::vector<int>)':
meandian.cpp:23:19: error: 'MedianScore' was not declared in this scope
   23 |         int res = MedianScore(temp[0], temp[1], temp[2], temp[3]);
      |                   ^~~~~~~~~~~