Submission #830162

# Submission time Handle Problem Language Result Execution time Memory
830162 2023-08-18T21:14:34 Z Liudas Jousting tournament (IOI12_tournament) C++17
Compilation error
0 ms 0 KB
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <vector>
#include <algorithm>
#include "tournament.h"
using namespace std;
int GetBestPosition(int N, int C, int R, int K[], int S[], int E[]){
    vector<int> arr(N-1);
    int id = 0, ms = 0;
    for(int i = 0; i < N-1; i ++){
        arr[i] = K[i];
    }
    for(int i = 0; i < N; i ++){
        vector<int> brr = arr;
        int score = 0;
        brr.insert(brr.begin()+i, R);
        for(int j = 0; j < C; j ++){
            vector<int> crr;
            int s = S[j], e = E[j];
            for(int k = 0; k < s; k ++){
                crr.push_back(brr[k]);
            }
            for(int k = e + 1; k < brr.size(); k ++){
                crr.push_back(brr[k]);
            }
            int maxi = *max_element(brr.begin() + s, brr.begin() + e + 1);
            if(maxi == R)score++;
            crr.insert(crr.begin() + s, maxi);
            swap(brr, crr);
        }
        if(score > ms){
            ms = score;
            id = i;
        }
    }
    return id;
}

Compilation message

tournament.cpp:6:10: fatal error: tournament.h: No such file or directory
    6 | #include "tournament.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.