제출 #380950

#제출 시각아이디문제언어결과실행 시간메모리
380950IwanttobreakfreeFinding Routers (IOI20_routers)C++17
컴파일 에러
0 ms0 KiB
#include "routers.h" #include <vector> using namespace std; vector<int> find_routers(int lon, int n, int q) { vector<int> ans(n); ans[0]=0; int l=0,r; for(int i=0;i<n-1;i++){ r=lon; int sol; while(l<=r){ int mid=(r-l)/2+l; int cercuse_detector(mid); if(cerc<i+1){ l=mid+1; sol=mid; } else{ r=mid-1; } } ans[i+1]=2*sol-ans[i]; l=sol; } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

routers.cpp: In function 'std::vector<int> find_routers(int, int, int)':
routers.cpp:15:9: error: 'cerc' was not declared in this scope
   15 |      if(cerc<i+1){
      |         ^~~~
routers.cpp:14:10: warning: unused variable 'cercuse_detector' [-Wunused-variable]
   14 |      int cercuse_detector(mid);
      |          ^~~~~~~~~~~~~~~~