#include "city.h"
#include <cmath>
#include <map>
#include <set>
#include <iostream>
void ComputeAdvice(int *C, int N, int K, int M)
{
for (int i=0;i<N;i++)
{
for (int j=0;j<=log2(N);j++)
{
if ((1<<j)&C[i])
WriteAdvice(1);
else
WriteAdvice(0);
}
}
}
#include "city.h"
#include <cmath>
#include <map>
#include <set>
#include <iostream>
void Assist(unsigned char *A, int N, int K, int R)
{
int re[N]={};
int z=log2(N);
map<int,int>d;
set<int>res[N]={};
for (int i=0;i<N;i++)
{
for (int j=0;j<=z;j++)
re[i]+=(A[i*(z+1)+j]<<j);
res[re[i]].insert(i);
d[re[i]]++;
}
set<int>ind;
for (int i=0;i<K;i++)
ind.insert(i);
for (int i=0;i<N;i++)
{
int z=GetRequest();
d[z]--;
res[z].erase(i);
if (ind.find(z)!=ind.end())
continue;
int x=0;
int f=-1;
for (auto i:ind)
{
if (d[i]==0)
{
x=i;
f=-1;
break;
}
else
{
if (res[i].size()&&*begin(res[i])>f)
{
f=*begin(res[i]);
x=i;
}
}
}
PutBack(x);
ind.insert(z);
ind.erase(x);
res[i].erase(f);
}
}
Compilation message
advisor.cpp:1:10: fatal error: city.h: No such file or directory
1 | #include "city.h"
| ^~~~~~~~
compilation terminated.
assistant.cpp:1:10: fatal error: city.h: No such file or directory
1 | #include "city.h"
| ^~~~~~~~
compilation terminated.