| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1259031 | tamzid | Finding Routers (IOI20_routers) | C++20 | 1 ms | 584 KiB |
#include <bits/stdc++.h>
#include "routers.h"
using namespace std;
using ll = long long;
const int N = 1e5 + 5;
vector<int> memo(N, -1);
std::vector<int> find_routers(int l, int n, int q) {
vector<int> ans;
ans.push_back(0);
for(int i=0;i<n-1;++i)
{
int low = 0, high = l, cc = -1;
while(low <= high)
{
int m = (low + high) / 2;
int idx;
if(memo[m] == -1)
{
memo[m] = use_detector(m);
}
idx = memo[m];
if(idx <= i)
{
low = m + 1;
}
else
{
cc = m;
high = m - 1;
}
}
int dis = cc - ans.back();
--dis;
ans.push_back(ans.back() + (dis * 2));
}
return ans;
}
| # | 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... | ||||
