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;
const int nx=1e3+5;
vector<int> f(nx);
void solve(int l, int r, int ql, int qr)
{
if (qr<ql) return;
if (l==r) return f[ql]=l, void();
int md=(l+r)/2, t=use_detector(md);
solve(l, md, ql, t);
solve(md+1, r, t+1, qr);
}
vector<int> find_routers(int L, int n, int q) {
int lst=0;
vector<int> res(n);
solve(1, L, 1, n-1);
for (int i=1; i<n; i++)
{
int cnt=f[i]-lst-2;
res[i]=f[i]+cnt;
lst=res[i];
}
return res;
}
# | 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... |