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