Submission #624239

#TimeUsernameProblemLanguageResultExecution timeMemory
624239MatesV13Finding Routers (IOI20_routers)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int rezultati[100005]; int nadi(int lo, int hi, int val){ if (lo==hi) return lo; int mid = (lo+hi+1)/2; if (!rezultati[mid]) rezultati[mid] = use_detector(mid) + 1; int odgovor = rezultati[mid]-1; if (odgovor >= val) return nadi(lo, mid-1, val); return nadi (mid, hi, val); } vector<int> find_routers(int l, int n, int q){ vector<int> poz; poz.push_back(0); while (poz.size() != n){ int temp = nadi(0, l, poz.size()); int idx = 2*temp-poz[poz.size()-1]; poz.push_back(idx); } return poz; }

Compilation message (stderr)

routers.cpp: In function 'int nadi(int, int, int)':
routers.cpp:9:20: error: 'use_detector' was not declared in this scope
    9 |   rezultati[mid] = use_detector(mid) + 1;
      |                    ^~~~~~~~~~~~
routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:20:20: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |  while (poz.size() != n){
      |         ~~~~~~~~~~~^~~~