제출 #836077

#제출 시각아이디문제언어결과실행 시간메모리
836077TrumlingRarest Insects (IOI22_insects)C++17
10 / 100
299 ms208 KiB
#include "insects.h"
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define pb push_back
#define INF 99999999999999



int min_cardinality(int N) 
{
  ll n=N;
  vector<bool>type;
  type.assign(n,0);
  ll ans=INF;
  for(int i=0;i<N;i++)
    {
      ll curr=1;

      if(type[i])
      continue;

      type[i]=1;
      move_inside(i);
      for(int j=0;j<N;j++)
        if(!type[j])
        {
          move_inside(j);
          ll now=press_button();
          if(now-1)
          {
            curr++;
            type[j]=1;
          }
          move_outside(j);
        }
      ans=min(ans,curr);
    }

  return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...