Submission #1240741

#TimeUsernameProblemLanguageResultExecution timeMemory
1240741nikulid드문 곤충 (IOI22_insects)C++20
10 / 100
99 ms408 KiB
#include "insects.h" #include <vector> using namespace std; int min_cardinality(int N) { vector<int> type(N); int answer=2001; for(int i=0; i<N; i++){ type[i]=i; } for(int l=0; l<N-1; l++){ if(type[l] != l) continue; move_inside(l); for(int r=l+1; r<N; r++){ move_inside(r); if(press_button()==2){ // they are the same type... type[r]=l; } move_outside(r); } move_outside(l); } vector<int> count(N, 0); for(int i=0; i<N; i++){ count[type[i]]++; } for(int i=0; i<N; i++){ if(count[i]>0){ answer=min(answer,count[i]); } } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...