제출 #624239

#제출 시각아이디문제언어결과실행 시간메모리
624239MatesV13Finding Routers (IOI20_routers)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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){
      |         ~~~~~~~~~~~^~~~