# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
382964 | Alma | Finding Routers (IOI20_routers) | C++17 | 0 ms | 0 KiB |
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 <bits/stdc++.h>
#include <routers>
using namespace std;
vector<int> find_routers(int l, int n, int q) {
int lo = 0, hi = l, mid, res = 0;
while (lo <= hi) {
mid = lo + (hi-lo) / 2;
if (use_detector(mid) == 0) {
res = mid;
hi = mid-1;
} else {
lo = mid+1;
}
}
vector<int> ans;
if (res == 0) {
ans = {0, 1};
} else {
ans = {0, 2*res};
}
return ans;
}