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