Submission #381073

#TimeUsernameProblemLanguageResultExecution timeMemory
381073BlancaHMFinding Routers (IOI20_routers)C++14
Compilation error
0 ms0 KiB
#include <iostream> #include <vector> 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; if (l&1) l--; int lo, hi, mid, k; for (int i = 1; i < n; i++) { lo = positions[i-1] + 2; hi = l; k = lo; while(lo <= hi) { mid = lo + (hi-lo)/2; if (use_detector(mid) == i-1) { k = mid; lo = mid+1; } else hi = mid-1; } positions[i] = k; } return positions; }

Compilation message (stderr)

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:18:8: error: 'use_detector' was not declared in this scope
   18 |    if (use_detector(mid) == i-1) {
      |        ^~~~~~~~~~~~