# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
627937 | lunchbox | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef vector<int> vi;
#ifdef LOCAL
void move_inside(int i);
void move_outside(int i);
int press_button();
#endif
int min_cardinality(int n) {
int c = 0;
vi u, v, in(n), p(n);
iota(p.begin(), p.end(), 0);
for (int i = 0; i < n; i++) {
move_inside(p[i]);
if (press_button() == 1) {
c++;
in[i] = 1;
} else {
move_outside(p[i]);
u.push_back(i);
}
}
int low = 2, hi = n / c, sz = 0, ans = 1;
while (low <= hi) {
int t = (low + hi) / 2;