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 "avoid.h"
#include <bits/stdc++.h>
using namespace std;
std::pair<int, int> scout(int R, int H) {
int l = 1, r = 1000, ans = -1;
while(l <= r) {
int m = (l + r) / 2;
vector<int> query;
for(int i = l; i <= m; ++i) {
query.push_back(i);
}
send(query);
bool ok = wait()[0];
if(ok) {
ans = m;
r = m - 1;
}
else {
l = m + 1;
}
}
const int a = ans;
l = 1, r = 1000, ans = -1;
while(l <= r) {
int m = (l + r) / 2;
vector<int> query;
for(int i = l; i <= m; ++i) {
query.push_back(i);
}
send(query);
bool ok = wait()[0];
if(ok) {
ans = m;
l = m + 1;
}
else {
r = m - 1;
}
}
const int b = ans;
assert(a != -1 and b != -1);
return {a, b};
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |