This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "insects.h"
#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(ll i=a,ioi=b;i<ioi;i++)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define imp(v) for(auto djfhg:v)cout<<djfhg<<" ";cout<<"\n"
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
//const ll MAXN=205;
void in(ll i){
move_inside(i);
}
void out(ll i){
move_outside(i);
}
ll ask(){
return press_button();
}
int min_cardinality(int N){
ll n=N;
vector<ll>a(n,-1);
fore(i,0,n){
if(a[i]!=-1)continue;
a[i]=i;
in(i);
fore(j,i+1,n){
in(j);
if(ask()==2)a[j]=i;
out(j);
}
out(i);
}
ll oc[n]={};
fore(i,0,n)oc[a[i]]++;
ll mn=n+5;
fore(i,0,n)if(oc[i]!=0)mn=min(mn,oc[i]);
return mn;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |