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 <bits/stdc++.h>
#include "routers.h"
using namespace std;
int answer[100002];
int ask (int x) {
if (answer[x] != -1)
return answer[x];
return answer[x] = use_detector(x);
}
vector<int> find_routers (int l, int n, int q) {
vector<int>p;
p.resize(n);
memset(answer, -1, sizeof(answer));
for (int i = 1; i < n; i++) {
int st = p[i - 1], dr = l, poz = 0;
while (st <= dr) {
int mij = (st + dr) / 2;
if (ask(mij) == i - 1) {
st = mij + 1;
poz = mij;
}
else
dr = mij - 1;
}
p[i] = p[i - 1] + 2* (poz - p[i - 1]);
}
return p;
}
/*int main () {
return 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |