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 "routers.h"
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
map<int,int> mp;
std::vector<int> find_routers(int L, int N, int q) {
vector<int> A(N);
for(int i=1;i<N;i++){
int l=A[i-1],r=L;
for(auto x:mp){
if(x.s==i-1) l=x.f;
}
for(auto x:mp){
if(x.s>=i){
r=x.f;
break;
}
}
while(l<r){
int mid=(l+r+1)/2;
if(!mp.count(mid)) mp[mid]=use_detector(mid);
if(mp[mid]==i-1) l=mid;
else r=mid-1;
}
A[i]=A[i-1]+(l-A[i-1])*2;
}
return A;
}
# | 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... |