제출 #381076

#제출 시각아이디문제언어결과실행 시간메모리
381076BlancaHMFinding Routers (IOI20_routers)C++14
39 / 100
2 ms492 KiB
#include <iostream> #include <vector> #include "routers.h" using namespace std; vector<int> find_routers(int l, int n, int q) { vector<int> positions(n, -1); // Vamos buscando los routers uno a uno positions[0] = 0; int lo, hi, mid, k; for (int i = 1; i < n; i++) { lo = positions[i-1]; hi = l; k = lo; while(lo <= hi) { mid = lo + (hi-lo)/2; if (use_detector(mid) < i) { k = mid; lo = mid+1; } else hi = mid-1; } positions[i] = k*2; } return positions; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...