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> find_routers(int L, int n, int q) {
int lst=0;
vector<int> res(n);
for (int i=1; i<n; i++)
{
int l=lst+1, r=L;
while (l<r)
{
int md=(l+r)/2;
if (use_detector(md)!=i-1) r=md;
else l=md+1;
}
int cnt=l-lst-2;
//cout<<"here "<<l<<' '<<cnt<<'\n';
res[i]=l+cnt;
lst=res[i];
//cout<<"debug "<<i<<' '<<res[i]<<'\n';
}
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... |