Submission #851471

# Submission time Handle Problem Language Result Execution time Memory
851471 2023-09-19T23:41:06 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

/usr/bin/ld: /tmp/ccNqaNee.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cctKiDWg.o:insects.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status