제출 #658402

#제출 시각아이디문제언어결과실행 시간메모리
658402coding_snorlax드문 곤충 (IOI22_insects)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
int All_type[200]={0};
int Box[200]={0};
int Check[200]={0};
/*
void move_inside(int i){
    Box[i]=1;
}
void move_outside(int i){
    Box[i]=0;
}
int press_button(){
    for(int i=0;i<200;i++){
        if(Box[i]) cout<<i<<" ";
    }
    cout<<endl;
    int answer;
    cin>>answer;
    return answer;
}
*/
int min_cardinality(int N){
    int level_1;
    for(int i=1;i<=N;i++){
        for(int j=0;j<N;j++){
            int tmp;
            if(!All_type[j]){
                move_inside(j);
                tmp=press_button();
                if(tmp>i){
                    move_outside(j);
                }
                else{
                    Check[j]=1;
                }
            }
        }
        int Count=0;
        for(int j=0;j<N;j++){
            if(Check[j]==1) {
                move_outside(j);
                Check[j]=0;
                Count++;
            }
        }
        if(i==1) level_1=Count;
        else if(Count<level_1*i) return i;
    }
    return N;

}
/*
int main(){
    cout<<min_cardinality(4);
}*/

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:29:17: error: 'move_inside' was not declared in this scope
   29 |                 move_inside(j);
      |                 ^~~~~~~~~~~
insects.cpp:30:21: error: 'press_button' was not declared in this scope
   30 |                 tmp=press_button();
      |                     ^~~~~~~~~~~~
insects.cpp:32:21: error: 'move_outside' was not declared in this scope
   32 |                     move_outside(j);
      |                     ^~~~~~~~~~~~
insects.cpp:42:17: error: 'move_outside' was not declared in this scope
   42 |                 move_outside(j);
      |                 ^~~~~~~~~~~~