#include "routers.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> find_routers(int l, int n, int q){
    vector<int> a(l+1, -1);
    vector<int> pos = {0};
    for(int i = 1; i < n; i++){
        int low = pos[i-1];
        int top = l;
        int ns = 0;
        while(low <= top){
            int mid = (low+top)/2;
            if(a[mid] == -1){
                a[mid] = use_detector(mid);
            }
            if(a[mid] < i){
                ns = mid;
                low = mid+1;
            }else{
                top = mid-1;
            }
        }
        pos.push_back(pos[i-1] + (ns - pos[i-1]) * 2);
    }
    return pos;
}
| # | 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... |