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 "routers.h"
using namespace std;
typedef vector<int> vi;
const int N = 1000;
int xx[N], cnt;
void solve(int xl, int xr, int il, int ir) {
if (il == ir)
return;
if (xr - xl == 1) {
xx[cnt++] = xl;
return;
}
int xm = (xl + xr) / 2, im = use_detector(xm);
solve(xl, xm, il, im), solve(xm, xr, im, ir);
}
vi find_routers(int l, int n, int q) {
cnt = 0, solve(0, l, 0, n - 1);
vi xx_(n, 0);
for (int i = 0; i + 1 < n; i++)
xx_[i + 1] = xx[i] * 2 - xx_[i];
return xx_;
}
# | 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... |