제출 #787694

#제출 시각아이디문제언어결과실행 시간메모리
787694khshg드문 곤충 (IOI22_insects)C++17
컴파일 에러
0 ms0 KiB
#include"insects.h" #include<bits/stdc++.h> using namespace std; int min_cardinality(int N) { int k; int D = 0; set<int> INs; for(int i = 0; i < N; ++i) { INs.insert(i); move_inside(i); k = press_button(); if(k == 2) { INs.erase(i); move_outside(i); continue; } ++D; } int tl = 1, tr = N / D; while(tl < tr) { int tm = (tl + tr + 1) / 2; vector<int> lst_added; for(int i = 0; i < N; ++i) { if(!INs.insert(i).second) continue; move_inside(i); k = press_button(); if(k > tm) { INs.erase(i); move_outside(i); continue; } lst_added.push_back(i); if(D * tm == (int)INs.size()) break; } if((int)INs.size() < D * tm) { tr = tm - 1; if(tl == tr) continue; for(auto& u : lst_added) { INs.erase(u); move_coutside(u); } } else { tl = tm; } } return (tl + tr) / 2; }

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:41:5: error: 'move_coutside' was not declared in this scope; did you mean 'move_outside'?
   41 |     move_coutside(u);
      |     ^~~~~~~~~~~~~
      |     move_outside