| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1255743 | iamsazidh | Finding Routers (IOI20_routers) | C++20 | 1 ms | 584 KiB |
/*
* Starting with the name of almighty ALLAH
*/
#include "routers.h"
using namespace std;
const int N = 1e5+5;
int memo[N];
vector<int> find_routers(int size, int n, int q) {
for (int i = 0; i < N; ++i)
{
memo[i] = -1;
}
vector<int> ans;
ans.push_back(0);
int last = 0;
for (int i = 0; i < n-1; ++i)
{
int l = 0, r = size;
int an = 0;
while(l<=r) {
int mid = (l+r)>>1;
int x = 0;
if(memo[mid]!=-1) {
x = memo[mid];
}else {
x = use_detector(mid);
memo[mid] = x;
}
if(x <= last) {
l = mid+1;
}else{
an = mid;
r = mid-1;
}
}
int lasti = ans[ans.size()-1];
int dis = an - lasti;
dis--;
ans.push_back(lasti+(dis*2));
last++;
}
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... | ||||
