제출 #728534

#제출 시각아이디문제언어결과실행 시간메모리
728534raul2008487드문 곤충 (IOI22_insects)C++17
컴파일 에러
0 ms0 KiB
#include "insects.h" int min_cardinality(int N) { vector<bool>fl(N,false); int i,j,cur=0,ans=0,mini=N,query=0; for(i=0;i<N-1;i++){ if(fl[i]){ continue; } fl[i]=true; move_inside(i); cur=1; for(j=i+1;j<N;j++){ if(!fl[j]){ fl[j]=true; move_inside(j); cur++; query=press_button(); if(query!=cur){ cur--; } move_outside(j); } } if(cur<mini){ mini=cur; ans=i; } if(mini==1){ return ans; } move_outside(i); } return ans; }

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:4:5: error: 'vector' was not declared in this scope
    4 |     vector<bool>fl(N,false);
      |     ^~~~~~
insects.cpp:4:12: error: expected primary-expression before 'bool'
    4 |     vector<bool>fl(N,false);
      |            ^~~~
insects.cpp:7:12: error: 'fl' was not declared in this scope
    7 |         if(fl[i]){
      |            ^~
insects.cpp:10:13: error: 'fl' was not declared in this scope
   10 |             fl[i]=true;
      |             ^~