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;
typedef long long ll;
std::vector<int> find_routers(int l, int n, int q) {
vector<int> res(n,0);
for(ll i=1;i<n;i++)
{
ll a = (res[i-1]+2), b = l;
b-=l%2;
res[i] = b;
while(a<=b)
{
ll m = (a+b)/2;
ll x = use_detector(m);
if(x<i) a=m+2;
else if(x==i) {
res[i] = m;
b = m-2;
}
else b=m-2;
}
res[i] = 2*res[i]-res[i-1]-2;
}
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... |