Submission #1230405

#TimeUsernameProblemLanguageResultExecution timeMemory
1230405lechaaFinding Routers (IOI20_routers)C++20
70.13 / 100
1 ms328 KiB
#include "routers.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<int> find_routers(int l, int n, int q) {
    vector<int> pos = {0};
    for(int i = 1; i < n; i++){
        int low = pos[i-1];
        int top = l;
        int ns = 0;
        while(low <= top){
            int mid = (low+top)/2;
            if(use_detector(mid) < i){
                ns = mid;
                low = mid+1;
            }else{
                top = mid-1;
            }
        }
        pos.push_back(pos[i-1] + (ns - pos[i-1]) * 2);
    }
    return pos;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...