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 <bits/stdc++.h>
using namespace std;
namespace {
int n, l, r , idx, ans;
int cnt=0;
const int INF=1e9;
vector<int> v;
} // namespace
void InitA(int N, int L, int R) {
n = N;
l = idx = L;
r = R;
for(int i=17;i>=0;i--){
SendA((l>>i)&1);
}
}
void ReceiveA(bool x) {
if(idx<=r&&x){
ans=idx;
}
idx++;
}
int Answer() {
return ans;
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int n;
vector<int> v(1000000);
int cnt=0;
int l=0;
} // namespace
void InitB(int N, vector<int> P) {
v=P;
n=N;
}
void ReceiveB(bool y) {
l=l*2+y;
cnt++;
if(cnt==18){
int mn=n+5;;
while(l<n){
if(v[l]<mn){
SendB(1);
mn=v[l];
}
else{
SendB(0);
}
l++;
}
}
}
Compilation message (stderr)
Anna.cpp:8:5: warning: '{anonymous}::cnt' defined but not used [-Wunused-variable]
8 | int cnt=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... |