Submission #658599

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