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) {
vector<bool> used(N);
int types = 0;
for (int i = 0; i < N; i++) {
move_inside(i);
if (press_button() > 1) {
move_outside(i);
continue;
}
types++;
used[i] = true;
}
for (int num = 2; num <= N; num++) {
int added = 0;
for (int i = 0; i < N; i++) {
if (used[i]) continue;
move_inside(i);
if (press_button() > num) {
move_outside(i);
continue;
}
added++;
used[i] = true;
}
if (added != types) {
return num-1;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |