# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1051271 | vjudge1 | Shopping (JOI21_shopping) | C++17 | 0 ms | 0 KiB |
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>
namespace {
int N, L, R;
int count;
} // namespace
void InitA(int N, int L, int R) {
::N = N;
::L = L;
::R = R;
count = 1;
for(int i=18;i--;)
SendA(L>>i&1);
}
std::vector<int>bools;
void ReceiveA(bool x) {
bools.push_back(x);
}
int Answer() {
for(int i=R;;i--)
if(bools[i-L])
return i;
return -1;
}