Submission #658601

#TimeUsernameProblemLanguageResultExecution timeMemory
658601pere_gilRarest Insects (IOI22_insects)C++17
25 / 100
327 ms444 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...