Submission #1334772

#TimeUsernameProblemLanguageResultExecution timeMemory
1334772yc11Rarest Insects (IOI22_insects)C++20
Compilation error
0 ms0 KiB
#include "insects.h"
#include<bits/stdc++.h>
using namespace std;
int min_cardinality(int N) {
    int ans = N;
    vector<int> n1;
    n1.assign(N,0);
    for (int i = 0;i<N;i++){
        int c = 1;
        vector<int> c1;
        c1.push_back(i);
        move_inside(i);
        if (n1[i]!=0) continue;
        for (int j = i+1;j<N;j++){
            move_inside(j);
            int c1 = press_button();
            if (c1==c+1){
                c++;
                n1[j] = 1;
                c1.push_back(i);
            }
            else move_outside(j);
        }
        for (int j = 0;j<c1.size();j++) move_outside(c1[j]);
        ans = min(ans,c);
    }
  return ans;
}

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:20:20: error: request for member 'push_back' in 'c1', which is of non-class type 'int'
   20 |                 c1.push_back(i);
      |                    ^~~~~~~~~