# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
858673 | 2023-10-09T04:27:29 Z | thinknoexit | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "insect.h" using namespace std; using ll = long long; bool ch[2020]; int min_cardinality(int n) { int mn = n; for (int i = 0;i < n;i++) { if (ch[i]) continue; ch[i] = 1; int cnt = 1; move_inside(i); for (int j = i + 1;j < n;j++) { move_inside(j); if (press_button() == 2) { cnt++; ch[j] = 1; } move_outside(j); } mn = min(mn, cnt); } return mn; }