#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int N, L, R, cnt, ans;
} // namespace
void InitA(int N, int L, int R) {
::N = N;
::L = L;
::R = R;
for (int i=13; i>=0; i--) SendA((L>>i)&1);
}
void ReceiveA(bool x) {
if (x&&L+cnt<=R) ans=L+(cnt++);
}
int Answer() {
return ans;
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int N, l=0, cnt=13;
vector<int> p;
}
void InitB(int N, std::vector<int> P) {
::N = N;
p=P;
}
void ReceiveB(bool y) {
l|=(y<<cnt);
cnt--;
if (cnt<0)
{
int mn=INT_MAX;
for (int i=l; i<N; i++)
{
if (p[i]<mn) SendB(1), mn=p[i];
else SendB(0);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |