This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "Anna.h"
#include <vector>
using namespace std;
namespace {
int L, R;
vector<bool> minima;
} // namespace
void InitA(int N, int L, int R) {
::L = L;
::R = R;
for(int bit=0;bit<18;bit++)SendA(L&(1<<bit));
}
void ReceiveA(bool x) {
minima.emplace_back(x);
}
int Answer() {
int last = 0;
for(int i=0;i<=R-L;i++){
if(minima[i])last=i;
}
return L+last;
}
#include "Bruno.h"
#include <vector>
using namespace std;
namespace {
vector<int> P;
int N;
int cnt;
int L;
} // namespace
void InitB(int N, std::vector<int> P) {
::N = N;
::P = P;
}
void ReceiveB(bool y) {
if(y)L|=1<<cnt;
cnt++;
if(cnt==18){
int currmin = 1e9;
for(int i=L;i<N;i++){
if(currmin>P[i]){
SendB(true);
currmin = P[i];
} else SendB(false);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |