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 "insects.h"
#include <bits/stdc++.h>
using namespace std;
int min_cardinality(int N) {
int n = N;
vector<bool> removed(n);
while (true) {
set<int> to_remove;
int not_removed = 0;
for (int i = 0; i < n; ++i) {
if (!removed[i]) {
move_inside(i);
not_removed++;
}
}
int x = press_button();
if (x == 1 || x == not_removed) return x;
for (int i = 0; i < n; ++i) {
if (!removed[i]) {
move_outside(i);
int y = press_button();
if (y < x) {
move_inside(i);
to_remove.insert(i);
}
}
}
for (int i : to_remove) {
move_outside(i);
removed[i] = true;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |