// M
#include<bits/stdc++.h>
#include "advisor.h"
using namespace std;
void ComputeAdvice(int * C, int n, int k, int m)
{
vector < int > Last(n, n), Nxt(n, n);
for (int i = n - 1; i >= 0; i --)
Nxt[i] = Last[C[i]], Last[C[i]] = i;
set < pair < int , int > > ST;
for (int i = 0; i < k; i ++)
ST.insert({-Last[i], i});
vector < int > M(n, 0);
for (int i = 0; i < n; i ++)
{
if (ST.count({-i, C[i]}))
{
ST.erase({-i, C[i]});
ST.insert({-Nxt[i], C[i]});
continue;
}
M[i] = 1;
ST.erase(ST.begin());
ST.insert({-Nxt[i], C[i]});
}
for (int i = 0; i < k; i ++)
WriteAdvice(Last[i] < n && !M[Last[i]]);
for (int i = 0; i < n; i ++)
WriteAdvice(Nxt[i] < n && !M[Nxt[i]]);
return ;
}
#include<bits/stdc++.h>
#include "assitant.h"
using namespace std;
void Assist(unsigned char * A, int n, int k, int len)
{
set < int > D, S;
for (int i = 0; i < k; i ++)
{
if (A[i] == 1)
S.insert(i);
else
D.insert(i);
}
for (int i = 0; i < n; i ++)
{
int c = GetRequest();
if (S.count(c))
{
S.erase(c);
if (A[k + i] == 1)
S.insert(c);
else
D.insert(c);
continue;
}
assert((int)D.size());
int a = * D.begin();
D.erase(D.begin());
PutBack(a);
if (A[k + i] == 1)
S.insert(c);
else
D.insert(c);
}
}
Compilation message
assistant.cpp:2:10: fatal error: assitant.h: No such file or directory
2 | #include "assitant.h"
| ^~~~~~~~~~~~
compilation terminated.