# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1232184 | dssfsuper2 | 드문 곤충 (IOI22_insects) | C++20 | 0 ms | 0 KiB |
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
set<int> ls;
void tomf(int nv){
}
int min_cardinality(int N) {
vector<int> representatives;
vector<vector<int>> groups;
groups.push_back({0});
move_inside(0);
for(int i = 1;i<N;i++){
move_inside(i);
int x = press_button();
if (x==1){
groups.push_back({i});
}
else{
for(int j = 0;j<groups.size();j++){
auto thing = groups[j];
move_outside(thing.back());
int x = press_button();
if (x==1){
groups[j].push_back(i);
break;
}
else{
move_inside(thing.back());
}
}
}
int t = 1000000000;
for(auto thing:groups){
t=min(t, (int)thing.size());
}
return t;
}