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"
int min_cardinality(int N) {
bool fl[N];
int i,j,cur=0,ans=0,mini=N,query=0;
for(i=0;i<N;i++){fl[i]=false;}
for(i=0;i<N;i++){
if(fl[i]){
continue;
}
fl[i]=true;
move_inside(i);
cur=1;
for(j=i+1;j<N;j++){
if(!fl[j]){
fl[j]=true;
move_inside(j);
cur++;
query=press_button();
if(query!=cur){
cur--;
}
move_outside(j);
}
}
if(cur<mini){
mini=cur;
ans=i;
}
if(mini==1){
return ans;
}
move_outside(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... |