제출 #658599

#제출 시각아이디문제언어결과실행 시간메모리
658599pere_gil드문 곤충 (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...