| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 851471 | fadi57 | 드문 곤충 (IOI22_insects) | C++17 | 0 ms | 0 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
    #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);
}
