Submission #426569

#TimeUsernameProblemLanguageResultExecution timeMemory
426569radaiosm7Finding Routers (IOI20_routers)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int i, lo, hi, mid; vector<int> find_routers(int l, int n, int q) { vector<int> ans(n); ans[0] = 0; for (i=1; i < n; ++i) { lo = ans[i-1]+2; hi = l; while (lo < hi) { mid = (lo+hi)/2; if (use_detector(mid) == i) { hi = mid; } else { lo = mid+1; } } ans[i] = 2*(mid-1)-ans[i-1]; } return ans; }

Compilation message (stderr)

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