제출 #1024428

#제출 시각아이디문제언어결과실행 시간메모리
1024428socpite마상시합 토너먼트 (IOI12_tournament)C++17
컴파일 에러
0 ms0 KiB
#include "advisor.h" #include "assistant.h" #include<bits/stdc++.h> using namespace std; void Assist(unsigned char *A, int N, int K, int R) { vector<int> bad; vector<int> active(N, 0); vector<int> prv(N, -1); for(int i = 0; i < K; i++){ active[i] = 1; if(!A[i])bad.push_back(i); prv[i] = i; } for(int i = 0; i < N; i++){ int x = GetRequest(); if(!active[x]){ if(prv[x] != -1)assert(!A[prv[x]]); active[bad.back()] = 0; active[x] = 1; PutBack(bad.back()); bad.pop_back(); } if(!A[i+K])bad.push_back(x); prv[x] = i+K; } } void ComputeAdvice(int *C, int N, int K, int M) { vector<int> ans(N+K, 0), prv(N, N), next(N), active(N, 0); set<pair<int, int>> st; for(int i = N-1; i >= 0; i--){ next[i] = prv[C[i]]; // cout << C[i] << " " << next[i] << endl; prv[C[i]] = i; } for(int i = 0; i < K; i++){ active[i] = 1; st.insert({prv[i], i}); prv[i] = i; } for(int i = 0; i < N; i++){ if(active[C[i]]){ ans[prv[C[i]]] = 1; st.erase(make_pair(i, C[i])); st.insert({next[i], C[i]}); } else{ auto tmp = *st.rbegin(); active[tmp.second] = 0; active[C[i]] = 1; st.erase(tmp); st.insert({next[i], C[i]}); } prv[C[i]] = i+K; } for(auto v: ans)WriteAdvice(v); }

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

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