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;
#include <cstdio>
const int MAX_N = 1000;
int splits[MAX_N];
void find_splits(int l, int r, int first_split, int last_split) {
if(first_split <= last_split && r - l > 1) {
int mid = (l + r) / 2;
int mid_split = use_detector(mid);
find_splits(l, mid, first_split, mid_split - 1);
find_splits(mid, r, mid_split, last_split);
} else if(r - l == 1) {
for(int i = first_split; i <= last_split; ++i)
splits[i] = l;
}
}
std::vector<int> find_routers(int l, int n, int q) {
find_splits(0, l + 1, 0, n - 2);
std::vector<int> pos;
pos.push_back(0);
for(int i = 0; i < n - 1; ++i)
pos.push_back(2 * splits[i] - pos.back());
return pos;
}
# | 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... |