제출 #830162

#제출 시각아이디문제언어결과실행 시간메모리
830162Liudas마상시합 토너먼트 (IOI12_tournament)C++17
컴파일 에러
0 ms0 KiB
#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; }

컴파일 시 표준 에러 (stderr) 메시지

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