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>
using namespace std;
int min_cardinality(int N) {
int types[N+1],found[N+1],cnt=1,ans=INT_MAX;
memset(types,0,sizeof types);
memset(found,0,sizeof found);
for(int i=0; i<N; i++) {
if(!found[i]) {
move_inside(i);
found[i] = cnt;
types[cnt]++;
cnt++;
for(int j=i+1; j<N; j++) {
if(!found[j])
move_inside(j);
if(press_button() > 1) {
found[j] = cnt-1;
types[cnt-1]++;
}
move_outside(j);
}
move_outside(i);
}
}
for(int i=0; i<=N; i++)
if(types[i])
ans=min(ans,types[i]);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |