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 get(int n, int x){
int tot_in=0;
bool in[n]={};
for(int i=0;i<n;i++){
move_inside(i);
if(press_button()>x) move_outside(i);
else{
tot_in++;
in[i]=true;
}
}
for(int i=0;i<n;i++) if(in[i]) move_outside(i);
return tot_in;
}
int min_cardinality(int n) {
int dif=get(n,1);
int res=n/dif;
while(true){
int in=get(n,res);
if(in==res*dif) break;
else res=in/dif;
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |