Submission #851470

# Submission time Handle Problem Language Result Execution time Memory
851470 2023-09-19T23:40:22 Z fadi57 Rarest Insects (IOI22_insects) C++17
Compilation error
0 ms 0 KB
    #include<bits/stdc++.h>
   // #include "insects.h"

    using namespace std;
    int n;
    const int mx=2e7+10;
    long long dp[mx];
 int min_cardinality(int N){
     int arr[N+1];
     for(int i=0;i<N;i++){
        arr[i]=-1;
     }
     map<int,int>mp;
    for(int i=0;i<n;i++){
        move_inside(i);
        if(arr[i]==-1){
            arr[i]=i;
        }
        for(int j=i+1;j<n;j++){
             move_inside(j);
           int z=  press_button();
           if(z==2){
            arr[j]=arr[i];
           }
             move_outside(j);
        }

    }
     for(int i=0;i<n;i++){
        mp[arr[i]]++;
    }
   int ans=n;
  for(int i=0;i<n;i++){
      ans=min(ans,mp[arr[i]]);
    }
 return ans;


 }
int main(){
cout<<min_cardinality(9);


}

Compilation message

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:15:9: error: 'move_inside' was not declared in this scope
   15 |         move_inside(i);
      |         ^~~~~~~~~~~
insects.cpp:21:20: error: 'press_button' was not declared in this scope
   21 |            int z=  press_button();
      |                    ^~~~~~~~~~~~
insects.cpp:25:14: error: 'move_outside' was not declared in this scope
   25 |              move_outside(j);
      |              ^~~~~~~~~~~~