제출 #634556

#제출 시각아이디문제언어결과실행 시간메모리
634556mosiashvililuka드문 곤충 (IOI22_insects)C++17
10 / 100
194 ms324 KiB
#include<bits/stdc++.h> #include "insects.h" using namespace std; int BO[2009]; int a,b,c,d,e,i,j,ii,jj,zx,xc,f[2009],fx[2009]; void ins(int q){ BO[q]=1; move_inside(q-1); } void outs(int q){ BO[q]=0; move_outside(q-1); } int ask(){ return press_button(); } void clea(){ for(int h=1; h<=a; h++){ if(BO[h]==1){ outs(h); BO[h]=0; } } } int min_cardinality(int N) { a=N;zx=0; for(i=1; i<=a; i++){ for(j=1; j<i; j++){ ins(j);ins(i); if(ask()==2){ f[i]=f[j]; clea(); break; } clea(); } if(f[i]==0){ zx++;f[i]=zx; } } for(i=1; i<=a; i++){ fx[f[i]]++; } zx=a+2; for(i=1; i<=a; i++){ if(fx[i]==0) continue; zx=min(zx,fx[i]); } return zx; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...