#include <bits/stdc++.h>
#include "routers.h"
using namespace std;
vector<int> find_routers(int l, int n, int q)
{
vector<int> ans;
ans.push_back(0);
int low = 1;
int high = l - 1;
while(low <= high)
{
int m = low + (high - low) / 2;
if(m & 1)
++m;
if(m >= l)
break;
if(use_detector(m) == 1)
{
low = m + 1;
ans.push_back(low);
}
else
{
high = m - 1;
}
}
if(ans.size() == 1)
{
ans.push_back(l-1);
}
return {0,ans.back()};
}
# | 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... |