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 res=1;
bool in[n]={};
int tot_in=0,dif=0;
for(;res<=n;res++){
for(int i=0;i<n;i++){
if(in[i]) continue;
move_inside(i);
in[i]=true;
tot_in++;
if(press_button()>res){
move_outside(i);
in[i]=false;
tot_in--;
}
if(tot_in==dif*res) break;
}
/*
printf("prof: %d: ",res);
for(int i=0;i<n;i++) if(in[i]) printf("%d ",i);
printf("\n");
*/
if(res==1) dif=tot_in;
if(tot_in<res*dif) break;
}
return res-1;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |