This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/**
* Simple.
*
* Steps needed: n * log(x)
* Implementation 1
*/
#include <bits/stdc++.h>
#include "routers.h"
typedef std::vector<int> vec;
vec find_routers(int l, int n, int q) {
vec ans = {0};
for (int i = 0; i < n - 1; i++) {
int prev = ans.back(), mid = prev;
for (int step = l / 2 + 1; step >= 1; step /= 2) {
while (mid + step <= l && use_detector(mid + step) == i)
mid += step;
}
ans.push_back(2 * mid - prev);
}
return ans;
}
# | 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... |