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"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> find_routers(int l, int n, int q) {
std::vector<int> sna;
int curr = n-1;
int low = 0, high = l, mid;
while (curr != 0) {
while (low != high) {
mid = (low+high+1)/2;
if (use_detector(mid) >= curr) high = mid-1;
else low = mid;
}
sna.push_back(low);
high = low-2;
low = 0;
curr--;
}
vector<int> ans;
ans.push_back(0);
for (int i = sna.size()-1; i >= 0; i--) {
ans.push_back(2*sna[i] - ans.back());
}
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... |