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;
vector<int> find_routers(int l, int n, int q) {
vector<int>r;
r.push_back(0);
for(int j=1;j<n;j++)
{
int last=r.back();
int low=(last+2)/2,high=(l-l%2)/2;
int mid=(low+high)/2,ans;
while(low<=high)
{
mid=(low+high)/2;
if(use_detector((mid*2+last)/2)==j-1)
{
ans=mid*2;
low=mid+1;
}
else high=mid-1;
}
r.push_back(ans);
}
//for(int i=0;i<r.size();i++)cout<<r[i]<<" ";
//cout<<endl;
return r;
}
# | 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... |