제출 #1233087

#제출 시각아이디문제언어결과실행 시간메모리
1233087porquenomedejainiciarsesion드문 곤충 (IOI22_insects)C++20
컴파일 에러
0 ms0 KiB
int min_cardinality(int N) {
    int ans=100000000;
    int suma=0;
    set<int> S;
    for(int i=0;i<N;i++){
        S.insert(i);
    }
    while(suma<N){
        int act=0;
        vector<int> borrar;
        for(auto x:S){
            move_inside(x);
            int uwu=press_button();
            if(uwu>act){
                act++;
                borrar.push_back(x);
            }else{
                move_outside(x);
            }
        }
        for(auto x:borrar){
            S.erase(x);
        }
        suma+=act;
        ans=min(ans,act);
    }
    return ans;
}

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

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:4:5: error: 'set' was not declared in this scope
    4 |     set<int> S;
      |     ^~~
insects.cpp:4:9: error: expected primary-expression before 'int'
    4 |     set<int> S;
      |         ^~~
insects.cpp:6:9: error: 'S' was not declared in this scope
    6 |         S.insert(i);
      |         ^
insects.cpp:10:9: error: 'vector' was not declared in this scope
   10 |         vector<int> borrar;
      |         ^~~~~~
insects.cpp:10:16: error: expected primary-expression before 'int'
   10 |         vector<int> borrar;
      |                ^~~
insects.cpp:11:20: error: 'S' was not declared in this scope
   11 |         for(auto x:S){
      |                    ^
insects.cpp:12:13: error: 'move_inside' was not declared in this scope
   12 |             move_inside(x);
      |             ^~~~~~~~~~~
insects.cpp:13:21: error: 'press_button' was not declared in this scope
   13 |             int uwu=press_button();
      |                     ^~~~~~~~~~~~
insects.cpp:16:17: error: 'borrar' was not declared in this scope
   16 |                 borrar.push_back(x);
      |                 ^~~~~~
insects.cpp:18:17: error: 'move_outside' was not declared in this scope
   18 |                 move_outside(x);
      |                 ^~~~~~~~~~~~
insects.cpp:21:20: error: 'borrar' was not declared in this scope
   21 |         for(auto x:borrar){
      |                    ^~~~~~
insects.cpp:22:13: error: 'S' was not declared in this scope
   22 |             S.erase(x);
      |             ^
insects.cpp:25:13: error: 'min' was not declared in this scope
   25 |         ans=min(ans,act);
      |             ^~~